Controlling Your Server: Difference between revisions

From San Andreas Multiplayer
Jump to navigationJump to search
No edit summary
No edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Controlling Your Server =
= Changing Gamemode =
== Contents ==
* [[1 Changing Gamemode]]
** [[1.1 Running a custom/downloaded gamemode]]
** [[1.2 Using Filterscripts]]
* [[2 Passwording your server]]
* [[3 Using RCON]]
** [[3.1 Logging In]]
** [[3.2 Bans]]
*** [[3.2.1 Removing bans]]
**** [[3.2.1.1 samp.ban]]
**** [[3.2.1.2 unbanip]]
**** [[3.2.1.3 reloadbans]]
*** [[3.2.2 Adding bans]]
**** [[3.2.2.1 samp.ban]]
**** [[3.2.2.2 Ban() function]]
**** [[3.2.2.3 RCON ban command]]
**** [[3.2.2.4 banip]]
** [[3.3 RCON Commands]]
** [[3.4 Related Callbacks and Functions]]


== 1. Changing Gamemode ==
== Running a custom/downloaded gamemode ==
=== 1.1 Running a custom/downloaded gamemode ===
# Open the directory you installed the server to (e.g., /Rockstar Games/GTA San Andreas/server).
Open the directory you installed the server to (eg: /Rockstar Games/GTA San Andreas/server).
# Take the downloaded/compiled .amx file and place it in the gamemodes folder where you installed the server.
Take the downloaded/compiled .amx file and place it in the gamemodes folder where you installed the server.
# Use RCON to change the mode as described above (2.1).
Use RCON to change the mode as described above (2.1).
# Alternatively, you can add the new mode to a rotation, also described above (2.3).
Alternatively you can add the new mode to a rotation, also described above (2.3).


=== 1.2 Using Filterscripts ===
== Using Filterscripts ==
The same as running a custom gamemode, except:
The same as running a custom gamemode, except:
Place the .amx in a folder called /filterscripts.
# Place the .amx in a folder called /filterscripts.
Add to server.cfg filterscripts scriptname.
# Add to server.cfg filterscripts scriptname.


== 2. Passwording your server ==
= Passwording your server =
If you want to add a password so only your friends can join, add this to server.cfg:
If you want to add a password so only your friends can join, add this to server.cfg:
password whatever
password whatever
This will make your server password-protected with the password set as 'whatever' - change it to whatever you want :)
This will make your server password-protected with the password set as 'whatever' - change it to whatever you want :)
You can also change the password while ingame by using /rcon password newpasswordhere. 
You can remove the password by using /rcon password 0, or by restarting the server.


== 3. Using RCON ==
You can also change the password while in-game by using /rcon password newpasswordhere. You can remove the password by using /rcon password 0, or by restarting the server.
=== 3.1 Logging In ===
 
You can log in either while ingame by typing '/rcon login password' or out of game by using the RCON mode in the Remote Console.
= Using RCON =
 
== Logging In ==
You can log in either while in-game by typing '/rcon login password' or out of game by using the RCON mode in the Remote Console.
The password is the same as what you set it as in server.cfg.
The password is the same as what you set it as in server.cfg.


=== 3.2 Bans ===
== Bans ==  
A ban is something that prevents an IP from connecting to the server.
A ban is something that prevents an IP from connecting to the server.


==== 3.2.1 Removing bans ====
=== Removing bans ===
Once somebody is banned, there are 2 ways to unban them
Once somebody is banned, there are 2 ways to unban them.
* Remove from samp.ban
# Remove from samp.ban.
* The RCON unbanip command
# The RCON unbanip command.


===== 3.2.1.1 samp.ban =====
==== samp.ban ====
samp.ban can be found in your sa-mp server directory, it contains lines with the following information about each ban:
samp.ban can be found in your sa-mp server directory; it contains lines with the following information about each ban:
* IP
* IP
* Date
* Date
* Time
* Time
* Name (Name of person or a reason (see BanEx))
* Name (Name of person or a reason (see BanEx))
* Type of ban (INGAME, IP BAN etc.)
* Type of ban (INGAME, IP BAN, etc.)


Examples:
Examples:
* 127.8.57.32 [13/06/09 | 69:69:69] NONE - IP BAN
* 127.8.57.32 [13/06/09 | 69:69:69] NONE - IP BAN
* 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN
* 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN


To unban them, simply remove the line, then execute the RCON reloadbans command to make the server re-read samp.ban.
To unban them, simply remove the line, then execute the RCON reloadbans command to make the server re-read samp.ban.


===== 3.2.1.2 unbanip =====
==== unbanip ====
The RCON unbanip command can be used in-game or from the server console (black box).
The RCON unbanip command can be used in-game or from the server console (black box). To unban an IP, simply type "/rcon unbanip IP_HERE" in-game or "unbanip IP_HERE" in the console.
To unban an IP, simply type "/rcon unbanip IP_HERE" in-game or "unbanip IP_HERE" in the console.


Example:
Example:
* 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN
* 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN
* /rcon unbanip 13.37.13.37 << INGAME
* /rcon unbanip 13.37.13.37 << INGAME
* unbanip 13.37.13.37 << CONSOLE
* unbanip 13.37.13.37 << CONSOLE


To unban them, simply use the unbanip command, then execute the RCON reloadbans command to make the server re-read samp.ban.
To unban them, simply use the unbanip command, then execute the RCON reloadbans command to make the server re-read samp.ban.


===== 3.2.1.3 reloadbans =====
==== reloadbans ====
samp.ban is the file that holds the information for the IPs that are currently banned from the server.
samp.ban is the file that holds the information for the IPs that are currently banned from the server. This file is read when the server is started, so if you unban an IP/person you MUST type the RCON reloadbans command to make the server read samp.ban again and allow them to join the server.
This file is read when the server is started, so if you unban an IP/person you MUST type the RCON reloadbans command to make the server read samp.ban again and allow them to join the server.
 
=== Adding bans ===
samp.ban is the file used for storing bans, including the following information about the ban:
* IP
* Date
* Time
* Name (Name of person or a reason, see BanEx)
* Type of ban
 
==== samp.ban ====
To add a ban, simply add a line like so:
IP_HERE [28/05/09 | 13:37:00] PLAYER - BAN REASON
Where IP_HERE is where you put the IP you would like to ban. This method takes longer than the RCON banip command, so I suggest using RCON banip.


==== 3.2.2 Adding bans ====
==== Ban() function ====
===== 3.2.2.1 samp.ban =====
The Ban function can be used to ban a player from a script. The BanEx function will add an optional reason like so:
samp.ban is the file used for storing bans, including the following information about the ban
* 13.37.13.37 [28/05/09 | 13:37:00] Cheater - INGAME BAN
* IP 
* Date 
* Time 
* Name (Name of person or a reason, see BanEx) 
* Type of ban 


To add a ban, simply add a line like so: 
==== RCON ban command ====
* IP_HERE [28/05/09 | 13:37:00] PLAYER - BAN REASON 
The RCON ban command, executed by typing /rcon ban in-game or typing "ban" in the console, is used to ban a specific player that is on your server. To ban an IP, see the next section.
Where IP_HERE is, is where you put the IP you would like to ban.
This method takes longer than the RCON banip command, so I suggest using RCON banip.


===== 3.2.2.2 Ban() function =====
Simply type:
The Ban function can be used to ban a player from a script. 
* /rcon ban PLAYERID <<INGAME
The BanEx function will add an optional reason like so:
* ban PLAYERID <<CONSOLE
* 13.37.13.37 [28/05/09 | 13:37:00] Cheater - INGAME BAN 


===== 3.2.2.3 RCON ban command =====
==== banip ====
The RCON ban command, executed by typing /rcon ban in-game or typing "ban" in the console, is used to ban a specific player that is on your server
The RCON banip command, executed by typing /rcon banip in-game or typing "banip" in the console, is used to ban a specific IP address. To ban a player on your server by ID, see the previous section. Will accept wildcards for range bans.
To ban an IP see the next section.
Simply type: 
* /rcon ban PLAYERID <<INGAME 
* ban PLAYERID <<CONSOLE 


===== 3.2.2.4 banip =====
Simply type:
The RCON banip command, executed by typing /rcon banip in-game or typing "banip" in the console, is used to ban a specific IP address. 
* /rcon banip IP <<INGAME
To ban a player on your server by ID, see the previous section. 
* banip IP <<CONSOLE
Will accept wildcards for range bans. 
Simply type:
* /rcon banip IP <<INGAME
* banip IP <<CONSOLE


=== 3.3 RCON Commands ===
== RCON Commands ==
Type cmdlist for commands (or, varlist for variables) making use of the RCON in-game ('/rcon cmdlist').
Type cmdlist for commands (or varlist for variables) making use of the RCON in-game ('/rcon cmdlist'). You do not need to type with [ ] they're just to highlight the parameter.
You do not need to type with [ ] they're just to highlight the parameter.


These are the functions that you as admin can use:
These are the functions that you as admin can use:
* /rcon cmdlist - Shows a list with commands.
* /rcon cmdlist - Shows a list with commands.
* /rcon varlist - Shows a list with the current variables.
* /rcon varlist - Shows a list with the current variables.
* /rcon exit - Closes the server.
* /rcon exit - Closes the server.
* /rcon echo [text] - Shows the [text] in the console of the server (NOT the client-console in-game).
* /rcon echo [text] - Shows the [text] in the console of the server (NOT the client-console in-game).
* /rcon hostname [name] - change the hostname text (example: /rcon hostname my server).
* /rcon hostname [name] - change the hostname text (example: /rcon hostname my server).
* /rcon gamemodetext [name] - change the gamemode text (example: /rcon gamemodetext my gamemode).
* /rcon gamemodetext [name] - change the gamemode text (example: /rcon gamemodetext my gamemode).
* /rcon mapname [name] - change the map name text (example: /rcon mapname San Andreas).
* /rcon mapname [name] - change the map name text (example: /rcon mapname San Andreas).
* /rcon exec [filename] - Executes the file which contains server cfg (example: /rcon exec blah.cfg).
* /rcon exec [filename] - Executes the file which contains server cfg (example: /rcon exec blah.cfg).
* /rcon kick [ID] - Kick the player with the given ID (example: /rcon kick 2).
* /rcon kick [ID] - Kick the player with the given ID (example: /rcon kick 2).
* /rcon ban [ID] - Ban the player with the given ID (example: /rcon ban 2).
* /rcon ban [ID] - Ban the player with the given ID (example: /rcon ban 2).
* /rcon changemode [mode] - This command will change the current gamemode to the given one (example: if you want to play sftdm: /rcon changemode sftdm).
* /rcon changemode [mode] - This command will change the current gamemode to the given one (example: if you want to play sftdm: /rcon changemode sftdm).
* /rcon gmx - Will load the next gamemode in server.cfg.
* /rcon gmx - Will load the next gamemode in server.cfg.
* /rcon reloadbans - reloads the samp.ban where the banned IP addresses are stored.
* /rcon reloadbans - reloads the samp.ban where the banned IP addresses are stored. Should be used after unbanning an IP address.
* Should be used after unbanning an IP address.
* /rcon reloadlog - reloads the server_log.txt. Has no noticeable effect on anything.
* /rcon reloadlog - reloads the server_log.txt. Has no noticeable effect on anything.
* /rcon say - shows a message to the players in the client-console (example: /rcon say hello will show as * Admin: hello).
* /rcon say - shows a message to the players in the client-console (example: /rcon say hello will show as * Admin: hello).
* /rcon players - Shows the players that are in the server (with their name, IP & ping).
* /rcon players - Shows the players that are in the server (with their name, IP & ping).
* /rcon banip [IP] - Ban the given IP (example: /rcon banip 127.0.0.1).
* /rcon banip [IP] - Ban the given IP (example: /rcon banip 127.0.0.1).
* /rcon unbanip [IP] - Unban the given IP (example: /rcon unbanip 127.0.0.1).
* /rcon unbanip [IP] - Unban the given IP (example: /rcon unbanip 127.0.0.1).
* /rcon gravity - Changes the gravity (example: /rcon gravity 0.008).
* /rcon gravity - Changes the gravity (example: /rcon gravity 0.008).
* /rcon weather [ID] - Changes the weather (example: /rcon weather 1).
* /rcon weather [ID] - Changes the weather (example: /rcon weather 1).
* /rcon loadfs - Loads the given filterscript (example: /rcon loadfs adminfs).
* /rcon loadfs - Loads the given filterscript (example: /rcon loadfs adminfs).
* /rcon weburl [server url] - Changes the server URL in the master lists/SA-MP client.
* /rcon weburl [server url]```mediawiki
* /rcon unloadfs - Unload the given filterscript (example: /rcon unloadfs adminfs).
* /rcon unloadfs - Unload the given filterscript (example: /rcon unloadfs adminfs).
* /rcon reloadfs - Reloads the given filterscript (example: /rcon reloadfs adminfs).
* /rcon reloadfs - Reloads the given filterscript (example: /rcon reloadfs adminfs).
* /rcon rcon_password [PASSWORD] - Change the rcon's password.
* /rcon rcon_password [PASSWORD] - Change the RCON's password.
* /rcon password [password] - Sets/resets the server password.
* /rcon password [password] - Sets/resets the server password.


=== The below commands are only available in 0.3z R2 and above. === 
The below commands are only available in 0.3z R2 and above.
* /rcon messageslimit [count] - Change the number of messages per second a client sends to the server. (default 500)
* /rcon messageslimit [count] - Change the number of messages per second a client sends to the server. (default 500).
* /rcon ackslimit [count] - Change the limit of acks (default 1000) (Since 0.3z R2-2, default limit is 3000)
* /rcon ackslimit [count] - Change the limit of acks (default 1000) (Since 0.3z R2-2, default limit is 3000).
* /rcon messageholelimit [count] - Change the limit of message holes (Also available in 0.3z R1) (default 3000)
* /rcon messageholelimit [count] - Change the limit of message holes (Also available in 0.3z R1) (default 3000).
* /rcon playertimeout [limit m/s] - Change the time in milliseconds until a player timeouts when not sending any packets. (default 1000)
* /rcon playertimeout [limit m/s] - Change the time in milliseconds until a player timeouts when not sending any packets. (default 1000).
* /rcon language [language] - Change the server language (example: /rcon language English). Shown in server browser.
* /rcon language [language] - Change the server language (example: /rcon language English). Shown in server browser.


The above four limits/counts are just made to avoid several tools which can attack any SA-MP server by freezing it or crashing.
The above four limits/counts are just made to avoid several tools which can attack any SA-MP server by freezing it or crashing. So, simply, just set them according to your server. The default values are default; if you see any wrong kicks, just increase the values as soon as possible so that the innocent players won't get kicked by it. More info: [http://forum.sa-mp.com/showpost.php?p=2990193&postcount=47 SA-MP Forum].
So, simply, just set them according to your server. The default values are default; if you see any wrong kicks, just increase the values as soon as possible so that innocent players won't get kicked by it.
More info: [http://forum.sa-mp.com/showpost.php?p=2990193&postcount=47]


== Related Callbacks and Functions ==
= Related Callbacks and Functions =
The following callbacks and functions might be useful, as they're related to this article in one way or another.
The following callbacks and functions might be useful, as they're related to this article in one way or another.


=== Callbacks: ===
== Callbacks ==
* OnRconLoginAttempt: Called when an attempt to login to RCON is made.
* OnRconLoginAttempt: Called when an attempt to login to RCON is made.


=== Functions: ===
== Functions ==
* IsPlayerAdmin: Checks if a player is logged into RCON.
* IsPlayerAdmin: Checks if a player is logged into RCON.
* SendRconCommand: Sends an RCON command via the script.
* SendRconCommand: Sends an RCON command via the script.

Latest revision as of 18:49, 1 November 2024

Changing Gamemode

Running a custom/downloaded gamemode

  1. Open the directory you installed the server to (e.g., /Rockstar Games/GTA San Andreas/server).
  2. Take the downloaded/compiled .amx file and place it in the gamemodes folder where you installed the server.
  3. Use RCON to change the mode as described above (2.1).
  4. Alternatively, you can add the new mode to a rotation, also described above (2.3).

Using Filterscripts

The same as running a custom gamemode, except:

  1. Place the .amx in a folder called /filterscripts.
  2. Add to server.cfg filterscripts scriptname.

Passwording your server

If you want to add a password so only your friends can join, add this to server.cfg: password whatever This will make your server password-protected with the password set as 'whatever' - change it to whatever you want :)

You can also change the password while in-game by using /rcon password newpasswordhere. You can remove the password by using /rcon password 0, or by restarting the server.

Using RCON

Logging In

You can log in either while in-game by typing '/rcon login password' or out of game by using the RCON mode in the Remote Console. The password is the same as what you set it as in server.cfg.

Bans

A ban is something that prevents an IP from connecting to the server.

Removing bans

Once somebody is banned, there are 2 ways to unban them.

  1. Remove from samp.ban.
  2. The RCON unbanip command.

samp.ban

samp.ban can be found in your sa-mp server directory; it contains lines with the following information about each ban:

  • IP
  • Date
  • Time
  • Name (Name of person or a reason (see BanEx))
  • Type of ban (INGAME, IP BAN, etc.)

Examples:

  • 127.8.57.32 [13/06/09 | 69:69:69] NONE - IP BAN
  • 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN

To unban them, simply remove the line, then execute the RCON reloadbans command to make the server re-read samp.ban.

unbanip

The RCON unbanip command can be used in-game or from the server console (black box). To unban an IP, simply type "/rcon unbanip IP_HERE" in-game or "unbanip IP_HERE" in the console.

Example:

  • 13.37.13.37 [28/05/09 | 13:37:00] Kyeman - INGAME BAN
  • /rcon unbanip 13.37.13.37 << INGAME
  • unbanip 13.37.13.37 << CONSOLE

To unban them, simply use the unbanip command, then execute the RCON reloadbans command to make the server re-read samp.ban.

reloadbans

samp.ban is the file that holds the information for the IPs that are currently banned from the server. This file is read when the server is started, so if you unban an IP/person you MUST type the RCON reloadbans command to make the server read samp.ban again and allow them to join the server.

Adding bans

samp.ban is the file used for storing bans, including the following information about the ban:

  • IP
  • Date
  • Time
  • Name (Name of person or a reason, see BanEx)
  • Type of ban

samp.ban

To add a ban, simply add a line like so: IP_HERE [28/05/09 | 13:37:00] PLAYER - BAN REASON Where IP_HERE is where you put the IP you would like to ban. This method takes longer than the RCON banip command, so I suggest using RCON banip.

Ban() function

The Ban function can be used to ban a player from a script. The BanEx function will add an optional reason like so:

  • 13.37.13.37 [28/05/09 | 13:37:00] Cheater - INGAME BAN

RCON ban command

The RCON ban command, executed by typing /rcon ban in-game or typing "ban" in the console, is used to ban a specific player that is on your server. To ban an IP, see the next section.

Simply type:

  • /rcon ban PLAYERID <<INGAME
  • ban PLAYERID <<CONSOLE

banip

The RCON banip command, executed by typing /rcon banip in-game or typing "banip" in the console, is used to ban a specific IP address. To ban a player on your server by ID, see the previous section. Will accept wildcards for range bans.

Simply type:

  • /rcon banip IP <<INGAME
  • banip IP <<CONSOLE

RCON Commands

Type cmdlist for commands (or varlist for variables) making use of the RCON in-game ('/rcon cmdlist'). You do not need to type with [ ] they're just to highlight the parameter.

These are the functions that you as admin can use:

  • /rcon cmdlist - Shows a list with commands.
  • /rcon varlist - Shows a list with the current variables.
  • /rcon exit - Closes the server.
  • /rcon echo [text] - Shows the [text] in the console of the server (NOT the client-console in-game).
  • /rcon hostname [name] - change the hostname text (example: /rcon hostname my server).
  • /rcon gamemodetext [name] - change the gamemode text (example: /rcon gamemodetext my gamemode).
  • /rcon mapname [name] - change the map name text (example: /rcon mapname San Andreas).
  • /rcon exec [filename] - Executes the file which contains server cfg (example: /rcon exec blah.cfg).
  • /rcon kick [ID] - Kick the player with the given ID (example: /rcon kick 2).
  • /rcon ban [ID] - Ban the player with the given ID (example: /rcon ban 2).
  • /rcon changemode [mode] - This command will change the current gamemode to the given one (example: if you want to play sftdm: /rcon changemode sftdm).
  • /rcon gmx - Will load the next gamemode in server.cfg.
  • /rcon reloadbans - reloads the samp.ban where the banned IP addresses are stored. Should be used after unbanning an IP address.
  • /rcon reloadlog - reloads the server_log.txt. Has no noticeable effect on anything.
  • /rcon say - shows a message to the players in the client-console (example: /rcon say hello will show as * Admin: hello).
  • /rcon players - Shows the players that are in the server (with their name, IP & ping).
  • /rcon banip [IP] - Ban the given IP (example: /rcon banip 127.0.0.1).
  • /rcon unbanip [IP] - Unban the given IP (example: /rcon unbanip 127.0.0.1).
  • /rcon gravity - Changes the gravity (example: /rcon gravity 0.008).
  • /rcon weather [ID] - Changes the weather (example: /rcon weather 1).
  • /rcon loadfs - Loads the given filterscript (example: /rcon loadfs adminfs).
  • /rcon weburl [server url] - Changes the server URL in the master lists/SA-MP client.
  • /rcon unloadfs - Unload the given filterscript (example: /rcon unloadfs adminfs).
  • /rcon reloadfs - Reloads the given filterscript (example: /rcon reloadfs adminfs).
  • /rcon rcon_password [PASSWORD] - Change the rcon's password.
  • /rcon password [password] - Sets/resets the server password.

The below commands are only available in 0.3z R2 and above.

  • /rcon messageslimit [count] - Change the number of messages per second a client sends to the server. (default 500).
  • /rcon ackslimit [count] - Change the limit of acks (default 1000) (Since 0.3z R2-2, default limit is 3000).
  • /rcon messageholelimit [count] - Change the limit of message holes (Also available in 0.3z R1) (default 3000).
  • /rcon playertimeout [limit m/s] - Change the time in milliseconds until a player timeouts when not sending any packets. (default 1000).
  • /rcon language [language] - Change the server language (example: /rcon language English). Shown in server browser.

The above four limits/counts are just made to avoid several tools which can attack any SA-MP server by freezing it or crashing. So, simply, just set them according to your server. The default values are default; if you see any wrong kicks, just increase the values as soon as possible so that the innocent players won't get kicked by it. More info: SA-MP Forum.

Related Callbacks and Functions

The following callbacks and functions might be useful, as they're related to this article in one way or another.

Callbacks

  • OnRconLoginAttempt: Called when an attempt to login to RCON is made.

Functions

  • IsPlayerAdmin: Checks if a player is logged into RCON.
  • SendRconCommand: Sends an RCON command via the script.