Controlling a Server

Changing Gamemode

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)

Using Filterscripts

The same as running a custom gamemode, except:

  • Place the .amx in a folder called filterscripts
  • Add the following 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 ingame 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 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

Adding Bans

samp.ban

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

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.

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:

# Ingame:
/rcon ban PLAYERID
# Console:
ban PLAYERID
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 rangebans.

Simply type:

# Ingame:
/rcon banip IP
# Console:
banip IP

Removing Bans

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

  • Remove from samp.ban
  • 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
# Ingame:
/rcon unbanip 13.37.13.37
# Console
unbanip 13.37.13.37

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 a 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.

RCON Commands

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:

CommandDescription
/rcon cmdlistShows a list with commands.
/rcon varlistShows a list with the current variables.
/rcon exitCloses 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 gmxWill load the next gamemode in server.cfg.
/rcon reloadbansreloads the samp.ban where the banned IP addresses are stored. Should be used after unbanning and IP address.
/rcon reloadlogreloads the server_log.txt. Has no noticeable effect on anything.
/rcon sayshows a message to the players in the client-console (example: /rcon say hello will show as Admin: hello).
/rcon playersShows 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 gravityChanges the gravity (example: /rcon gravity 0.008).
/rcon weather [ID]Changes the weather (example: /rcon weather 1).
/rcon loadfsLoads the given filterscript (example: /rcon loadfs adminfs).
/rcon weburl [server url]Changes the server URL in the masterlists/SA-MP client
/rcon unloadfsUnload the given filterscript (example: /rcon unloadfs adminfs).
/rcon reloadfsReloads 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 following commands are only available in 0.3z R2 and above:

CommandDescription
/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. Read more here/

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

Functions