Controlling Your Server
From SA-MP Wiki
Running a custom/downloaded gamemode
- 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
- 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)
The same as running a custom gamemode, except:
- Place the .amx in a folder called /filterscripts
- 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:
- 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.
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.
The password is the same as what you set it as in server.cfg
A ban is something that prevents a IP from connecting to the server.
Once somebody is banned, there are 2 ways to unban them.
- Remove from samp.ban
- The RCON unbanip command
samp.ban can be found in your sa-mp server directory, it contains lines with the following information about each ban:
- Name (Name of person or a reason (see BanEx))
- Type of ban (INGAME, IP BAN etc,)
127.8.57.32 [13/06/09 | 69:69:69] NONE - IP BAN 126.96.36.199 [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.
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.
188.8.131.52 [28/05/09 | 13:37:00] Kyeman - INGAME BAN /rcon unbanip 184.108.40.206 << INGAME unbanip 220.127.116.11 << CONSOLE
To unban them, simply use the unbanip command, then execute the RCON reloadbans command to make the server re-read samp.ban.
samp.ban is the file that holds the information for the IP's 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.
samp.ban is the file used for storing bans, including the following information about the ban:
- Name (Name of person or a reason, see BanEx)
- Type of 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, 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.
18.104.22.168 [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.
/rcon ban PLAYERID <<INGAME ban PLAYERID <<CONSOLE
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 rangebans.
/rcon banip IP <<INGAME banip IP <<CONSOLE
Type cmdlist for commands (or, varlist for variables) making use of the RCON in-game ('/rcon cmdlist').
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 and 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 masterlists/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
Related Callbacks and Functions
The following callbacks and functions might be useful, as they're related to this article in one way or another.
- OnRconLoginAttempt: Called when an attempt to login to RCON is made.
- IsPlayerAdmin: Checks if a player is logged into RCON.
- SendRconCommand: Sends an RCON command via the script.