This wiki is archived and useful information is being migrated to the main bzflag.org website
BZFS API Functions
From BZFlagWiki
A comparison and overview of BZFS API Functions.
BZFS API Function | Description |
bool bz fileReport | API function will file a report message to the report channel. |
bz addURLJob | This function is used to send out HTTP requests from bzfs to external websites. It can be used to send data to a site, or request data from a site. It will transfer the data in the background and call the handler parameter as the data is updated. |
bz_BZDBItemExists | This function checks to see if a BZDB variable exists. |
bz_cancelCountdown | This function stops the countdown before a match has been started. |
bz_canPlayerSpawn | This function returns true if the specified player is allowed to spawn, false if they are not. |
bz debugMessage | This function prints a standard debug message. |
bz debugMessagef | This function outputs a debug message to. |
bz_deleteIntList | This function deletes the bz_APIIntList given freeing up memory. |
bz fireWorldGM | This function fires a Guided Missile at a player. |
bz fireWorldWep | This API function will fire w worldweapon at the specified location with the specified parameters. |
bz flagPlayer | This API function returns the ID of the player that is carrying the specified flag. If the flag is on the ground, it will return -1. |
bz_freePlayerRecord | This API function frees the player record specified. This should be called on each player record after it's no longer needed, to release the memory used by that player record. |
Bz gameOver | This API function creates a Game Over, announcing the players and/or team(s) specified as the winner. |
bz_getAdmin | This API function checks to see if the specified player is an administrator (has the ability to ban). |
bz_getBZDBBool | This API function gets the value of a variable. (ex. _shotsKeepVerticalVelocity, _speedChecksLogsOnly, ect) |
bz_getBZDBDouble | This API function returns the value of a variable. (ex. _shotSpeed, _tankSpeed, ect) |
bz_getBZDBInt | This API function gets the value of a variable. (ex. _tankSpeed, _shotSpeed, ect) |
bz_getBZDBString | This API function gets the value of a variable. (ex. _rainType, _rainTexture, ect) |
bz getClientWorldDownloadURL | This API function returns the current string used for the URL of the cached world. This is the URL that will be sent to all clients as an optional download location for the map file. |
bz_getCountdownRemaining | This API function retrieves the time remaining in a running countdown. |
bz_getCurrentTime | This API function gets the current server time. |
bz_getDebugLevel | This API function gets the debugging level of the server. |
bz getFlagName | This API function returns the flag code for the specified flag. |
bz getFlagPosition | This API function fill out the pos parameter with the position of the specified flag and return true. If the specified flag ID is invalid, the function will return false. |
bz getGameType | This API function returns a value of type bz_eGameType representing the game type the server is playing |
bz_getGroupList | This API function returns the groups on the server. |
bz_getGroupPerms | This API function returns the list of permissions for the group provided. |
bz_getIdleTime | This API function returns the amount of time a player has been idle in seconds. If the player ID does not exist or the player is an observer, it will return -1; otherwise it will return 0 if the player has not been idle. |
bz_getLagWarn | This API function gets the amount that players will the a lag warning. (ex. 300ms, 500ms) |
bz_getLoadedPlugins | This API function retrieves the names of all loaded plugins and counts how many of them there are. |
bz_getLocaltime | This API function fills a bz_localTime object with values for the current time on the server. |
bz_getMaxWaitTime | This API function returns the maximum wait (or idle) time for the server. |
bz getNumFlags | This API function returns the total number of flags in the game. |
bz_getPausedTime | This API function returns the amount of time a player has been paused in seconds. |
bz_getPlayerByIndex | This API function gets the information for the player at the index specified. The index should be one of the elements of the list returned by bz_getPlayerIndexList. The returned player info won't update as the game progresses. |
bz_getPlayerBySlotOrCallsign | This API function gets the information for the player with the specified slot index or callsign. The returned player info won't update as the game progresses. |
bz_getPlayerCallsign | This API function retrieves the callsign of a player. |
bz_getPlayerCount | This API function returns the number of users on the server. |
bz_getPlayerCurrentState | This API function gets the specified player's current state. This includes information about how fast they're traveling, if they're in the air, if they're rotating, and more. |
bz_getPlayerFlag | This API function gets the flag ID of the flag that the specified player is currently holding. |
bz getPlayerFlagID | This API function returns the flag ID for the flag a player is carrying. If the player does not exist or does not have a flag, it will return -1. |
bz_getPlayerHumanity | This API function returns true if the player has reported that they are human and not a robot. |
bz_getPlayerIndexList | This API function returns a list of players indexes. Same as bz_getPlayerIndexList(bz_APIIntList), but a new bz_APIIntList is created and returned. This newly-created api int list must be deleted when it is no longer needed. |
Bz getPlayerIndexList(bz APIIntList) | This API function gets the current list of players, and places them in the int list specified. The values are the player indexes, which can be passed to bz_getPlayerByIndex to get information about the player. |
bz_getPlayerIPAddress | This API function returns the player's IP Address. |
bz_getPlayerJitter | This API function returns the amount of jitter the player has. |
bz_getPlayerLag | This API function returns the amount of lag the player has. |
bz_getPlayerLosses | This API function returns the amount of losses for the player given. |
bz_getPlayerPacketloss | This API function returns the amount of packetloss the player has. |
bz_getPlayerRank | This API function returns the rank of the player given. |
bz_getPlayerSpawnAtBase | This API function checks if a player is supposed to spawn at their base on their next respawn. |
bz_getPlayerTeam | This API function returns the player's team. |
bz_getPlayerTKs | This API function returns the amount of TKs for the player given. |
bz_getPlayerWins | This API function returns the amount of wins for the player given. |
bz_getPublic | This API function retrieves whether the server is successfully connecting and authenticating with the list server. |
bz_getPublicAddr | This API function returns the string that was specified with the BZFS option -publicaddr or the default address that is used when starting up a public server. |
bz_getPublicDescription | This API function retrieves the string with the title of the server, generally displayed on the list server when players are finding a game to join. This is what one would specify with the -publictitle BZFS option. |
bz_getPublicPort | This API function retrieves the port the server communicates with. Normally this is specified with the -p BZFS option, but defaults to 5154. |
bz_getReports | This API function retrieves reports made by other players in the same format as the /viewreports command does. |
bz getShotGUID | This API function will return the Globally Unique Identifier(GUID) for the specified shot if it exists, or 0 if it does not. |
bz getShotMetaData | This API function will return the data associated with the specified name for the specified shot. If the shot does not exist, or does not have any data for the name the function will return 0. |
bz_getShotMismatch | This API function returns true if the server checks for shot mismatches. |
bz_getTeamCount | This API function gets the amount of players on a team. |
bz_getTeamLosses | This API function gets the losses of a team. |
bz getTeamPlayerLimit | This API function will return the maximum number of players that the server is configured to allow for the specified team. |
bz_getTeamScore | This API function gets the score for a team. |
bz_getTeamWins | This API function gets the wins of a team. |
bz_getTimeLimit | This API function retrieves the value of the time limit that was last set. |
bz_getUTCtime | This API function fills a bz_Time object with values for the Universal Time Coordinated (UTC) time. |
bz givePlayerFlag | This API function will give the specified player the specified flag. If the player has no flag, they will get a flag. If they have a flag and the force parameter is true the new flag code will replace the old flag code. If the force parameter is false, and the player has a flag, no action will be taken. |
bz_grantPerm | This API function grants the specified player the specified permission. After this method has been called, calls to bz_hasPerm, passing in this player's id and the permission specified, will return true. |
bz_groupAllowPerm | This API function grants the group a certain permission. |
bz_hasPerm | This API function checks to see if the player specified has the permission specified. |
bz_HostBanUser | This API function sets up a new Host ban Rule in the ban list. |
bz_HostUnbanUser | This API function unbans a host name that has been previously banned. |
bz_IDUnbanUser | This API function unbans a bzID address currently listed in the ban list. Note: The bzID is automatically assigned via the registration process at the BZBB. |
bz_incrementPlayerLosses | This API function increments the losses of a player. |
bz_incrementPlayerTKs | This API function increments the team-kill count of a player. |
bz_incrementPlayerWins | This API function increments the wins of a player. |
bz_incrementTeamLosses | This API function increment the losses of a team. |
bz_incrementTeamWins | This API function increment the wins of a team. |
bz_IPBanUser | This API function sets up a new IP Rule in the ban list. Note that if the player is currently playing when their IP address is banned it will not take effect immediately until they rejoin. This can be counteracted by kicking the player upon the ban, or using bz_IDBanUser() instead. |
bz_IPUnbanUser | This API function unbans an IP address that is currently listed in the ban list. |
bz_isCountDownActive | This API function retrieves whether or not the countdown is active. The countdown timer is active if the timer is continuing to go down every second. |
bz_isCountDownInProgress | This API function retrieves whether or not the countdown to the start of the match is occurring. |
bz_isCountDownPaused | This API function retrieves whether or not the countdown is paused. |
bz_isPlayerPaused | This API function returns true if the specified player is currently paused, false if they are not. |
bz_isPlayerSpawnable | This API function checks if player has the ability to spawn. This is not to be confused with the SPAWN permission but instead, this should be used together with bz_setPlayerSpawnable. |
bz_isTimeManualStart | This API function retrieves whether or not the time limit has to be started via a player issuing the /countdown command. The -timemanual BZFS option would make this return value true. |
bz_kickUser | This API function kicks an user from the server (same as the /kick command). |
bz_loadPlugin | This API function attempts to load a plugin with the given path and filename along with any passed parameters. |
bz moveFlag | This API function moves the specified flag. If the flag is carried, it will be dropped. If reset is true, the flag is also "zapped" to the new location ( ring graphical effect). |
bz_newIntList | This API function creates a new bz_APIIntList. |
bz_pauseCountdown | This API function pauses the countdown that is currently running. |
bz_pollActive | If a poll is active, this function will return true. |
bz_pollVeto | This API function vetos an active poll. |
bz RegisterCustomFlag | This API function registers a custom flag. The registered abbreviation must be unique (that is, may not conflict with existing built-in or API flags). |
bz_registerCustomSlashCommand | This API function registers a custom slash commands that is used by the plugin. The event listener must later be unregistered by a call to bz_removeCustomSlashCommand in the bz_Unload (2.0.x) or Cleaup() (2.4+) function. |
bz_registerEvent | This API function registers a new event handler. This event handler will receive events of the event type specified. |
bz_reloadBadwords | This API function reloads the bad words for the server. |
bz_reloadGroups | This API function reloads the group file for the server. |
bz_reloadHelp | This API function reloads the help files for the server. |
bz_reloadLocalBans | This API function reloads the local ban list. |
bz_reloadMasterBans | This API function reloads the master ban list. |
bz_reloadUsers | This API function reloads the user database for the server. |
bz_removeCustomSlashCommand | This API function removes all custom slash commands that were created with the plugin. The event listener must previously have been added by a call to bz_registerCustomSlashCommand. |
bz_removeEvent | This API function removes the specified event listener. The event listener must previously have been added by a call to bz_registerEvent. |
bz removePlayerFlag | This API function forces the specified player to drop the flag that is currently carried. The flag will be reset following the standard flag spawn logic. |
bz_resetALLBZDBVars | This API function resets all the BZDB (/set) variables. |
bz_resetBZDBVar | This API function resets the value of a variable. (Putting "" as the variable will reset them all). |
bz resetFlag | This API function reset (respawn) the flag corresponding to the specified flag ID. If the flag is carried by a player, the player will loose the flag. |
bz resetFlags | This API function will force all flags to be reset and respawned. If the onlyUnused parameter is true, then flags carried by players will not be reset, otherwise all flags will be reset. If the keepTeamFlags parameter is true, then team flags will not be reset. |
bz_resetPlayerScore | This API function resets the score of a player. |
bz_resetTeamScore | This API function resets the score of a team. |
bz_resetTeamScores | This API function resets all team scores. |
bz restart | This API function will cause the server to do a full restart. This restart will perform the following actions kick all players, stop any countdowns, stop any recordings, unload the world, reload the world, resets all flags, accept new connections. |
bz_resumeCountdown | This API function resumes the countdown that is currently paused. |
bz_revokePerm | This API function revokes the specified permission on the specified player. The player then loses this permission. |
bz saveWorldCacheFile | This API function forces the server to save out a world cache file into the specified file. The function will return true if the write was sucsessfull, or false if there was an error. |
bz sendTextMessage | This API function will cause the server to send a text message to a single player, all players, or team. The text message can be made to appear from any user or the server itself. |
bz sendTextMessagef | This API function sends a message to a single player, all players, or all players on a team using printf-style formatting. |
bz_setBZDBBool | This API function sets a BZDB variable to a given bool value. |
bz_setBZDBDouble | This API function sets a BZDB variable to a given double value. |
bz_setBZDBInt | This API function sets a BZDB variable to a given int value. |
bz_setBZDBString | This API function sets a BZDB variable to a given string value. |
bz setClientWorldDownloadURL | This function sets the current URL used to download a cached world file. It will be sent to clients that connect giving them the option of using that file. This is helpful if the plug-ins have changed the map file during a a call to bz_restart. |
bz_setLagWarn | This API function sets the maximum lag a player can have before triggering a lag warning. |
bz_setMaxWaitTime | This API function sets the maximum wait (or idle) time. |
bz_setPlayerOperator | This API function marks this player as a server operator. A player typically becomes a server operator by providing the correct password to the /password command. |
bz_setPlayerSpawnable | This API function marks this player as allowed to spawn or not allowed to spawn. |
bz_setPlayerSpawnAtBase | This API function forces a player to spawn at their base on only their next respawn. |
bz_setPlayerTKs | This API function sets the tks of a player. |
bz_setPlayerWins | This API function sets the wins of a player. |
bz setShotMetaData | This API function will set the specified data and associated it with the specified shot. If the shot does not exist the function will do nothing. Setting data for a name on a shot will replace any previous data that was associated with the name. |
bz_setShotMismatch | This API function enables or disables the check for a shot mismatch. |
bz_setTeamLosses | This API function sets the losses of a team. |
bz_setTeamWins | This API function sets the wins of a team. |
bz_setTimeLimit | This API function sets the countdown timer to a new value. Note: Any players that retrieved the countdown value before this function is called will not see the changes until they rejoin or a new countdown is triggered via bz_startCountdown(). |
bz shotHasMetaData | This API function will return true if the specified shot exists and has data stored under the specified name. |
bz_shutdown | This API function shutsdown the server. |
bz_startCountdown | This API function begins the starting countdown process as if a player were to type /countdown. |
bz_superkill | This API function kicks all users from the server. |
bz_unloadPlugin | This API function unloads a plugin that is currently loaded. |
bz_updatePlayerData | This API function updates the data in a bz_BasePlayerRecord to the current state of that player. The information in a base player record instance is not kept up-to-date as the game progresses, so this method must be called to get the most up-to-date information. |
bz validAdminPassword | This API function will return true if the passed in password is a valid server admin password. |