BF:BC2 server commands

Battlefield: Bad Company 2 and Medal of Honor, which are both based on the Frostbite engine.
Post Reply
User avatar
Edge100x
Founder
Founder
Posts: 12359
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

BF:BC2 server commands

Post by Edge100x » Tue Mar 02, 2010 12:49 pm

Here are some common commands that you can execute through the rcon tool on our "Server control" page. But first, some notes on usage:

- If you need to specify a string containing spaces for anything, use quote marks "" around it.
- If you need to specify a quotation mark, put a \ (backslash) before it.
- If you need to specify a backslash, put a \ (backslash) before it.
- Do not enter the < or > characters -- these are just markers here to show what is a variable and needs to be replaced.

help : Shows a basic command listing.

admin.runScript <filename> : Executes a file in the "AdminScript" directory of the server, such as "Startup.txt" or a file that you have custom-defined.

punkBuster.pb_sv_command <command> : Executes a raw punkbuster command on the server. You can use this to set up timed messages, etc.

admin.yell <message> <duration in ms> <players> : Displays a message on players' screens for the amount of time indicated. The duration is measured in milliseconds and must be >0 and <60000 -- for instance, 10000 means 10 seconds. The message must be less than 100 characters long. "players" can be "all", "team <team number>", "squad <squad number>" or "player <playername>".

Example: admin.yell "This is a test" 6000 "all"

admin.say <message> <players> : Sends a chat message to players. The message must be less than 100 characters long, and "players" is in the same format that admin.yell uses.

admin.runNextLevel : Switches to the next level in the map cycle.

admin.restartMap : Ends the current round and restarts with the same map.

admin.listPlayers <players> : Lists all players in the server (<players> is in the same format as it is for admin.yell). In the list, it starts by saying how many clients there are total, then lists each attribute that it will be giving for each client, then gives those attributes for each client.

admin.kickPlayer <player name> : Kicks a specified player. You can find the exact player name from admin.listPlayers.

banList.add <id type> <id> <timeout> <reason> : Ban a player for the specified amount of time, with the specified reason (the reason is optional and may be omitted). "Type" can be "guid", "name", or "ip". "Timeout" can be "perm" for permanent, "round" for until the end of the round, or "seconds <seconds>" for some number of seconds.

banList.list : Get a list of all the bans on the server. The list will start with a line telling you how many bans are in it, then will list each ban as a set of 5 entries: id type, id, ban type, time, and reason.

banList.remove <id type> <id> : Unbans a player. To get the "id type" and "id", use banList.list.

banList.clear : Clear the entire ban list at once.

banList.save : Save bans to disk. The ban file is automatically automatically loaded upon every server start and can also be manually loaded with with banList.load.

banList.load: Loads the previously saved ban list from disk.

reservedSlots.load : Re-load the reservedslotslist.txt file that is loaded by the game when it starts. You can change the contents of this file through the "Easy setup" page in your control panel.

reservedSlots.save : Re-save the reservedslotslist.txt file.

reservedSlots.addPlayer <player name> : Grant a player a reserved slot by adding him to the list.

reservedSlots.removePlayer <player name> : Remove a player's reserved slot.

reservedSlots.clear : Clear all reserved slots at once.

reservedSlots.list : List the current reserved slots.

mapList.load, mapList.save, mapList.list, mapList.clear, mapList.remove : These behave just as the reservedSlots functions do.

mapList.append <map name> : Adds a map to the end of the current map list.

mapList.insert <index> <map name> : Adds a map to the list at a specific position.

mapList.nextLevelIndex : Gives the index of the next level that the server will be running.

mapList.nextLevelIndex <index> : Set the index of the next level to be run to "index".

admin.setPlaylist <playlist> : Sets the playlist (game mode). You an either use "RUSH", "CONQUEST", "SQDM", or "SQRUSH". The change will occur after the current round, and note that it will make your current maplist invalid (so you'll have to create a new one).

admin.getPlaylist : Shows the current playlist (game mode).

admin.getPlaylists : Shows all the playlist options.

admin.supportedMaps <playlist> : Lists all the maps supported under a certain playlist (the playlists available can be seen through "admin.getPlaylists").

vars.gamePassword, vars.punkBuster, vars.hardCore, vars.ranked, vars.rankLimit, vars.teamBalance, vars.friendlyFire, vars.playerLimit, vars.bannerUrl, vars.serverDescription, vars.killCam, vars.miniMap, vars.crossHair, vars.3dSpotting, vars.miniMapSpotting, vars.thirdPersonVehicleCameras : These do as you might expect, and "true" or "false" is used for most of them. You should set them through your "Easy setup" page instead, so that they are saved across server restarts.
Last edited by Edge100x on Fri Apr 09, 2010 9:41 pm, edited 13 times in total.

User avatar
Edge100x
Founder
Founder
Posts: 12359
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: BF:BC2 server commands

Post by Edge100x » Wed Mar 03, 2010 4:06 pm

The definitive (DICE-released) reference for the rcon protocol is here: http://blogs.battlefield.ea.com/battlef ... c2-pc.aspx

Edit: This link no longer works; we do not yet have an updated one.

User avatar
Edge100x
Founder
Founder
Posts: 12359
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: BF:BC2 server commands

Post by Edge100x » Fri Apr 09, 2010 10:51 am

This has now been updated to reflect version R9, which changes the way that map cycles work and bans work.

Post Reply