This wiki is archived and useful information is being migrated to the main bzflag.org website

Difference between revisions of "Bz givePlayerFlag"

From BZFlagWiki
Jump to: navigation, search
(Clarify what flagType ACTUALLY returns.)
(Description: typo)
 
(One intermediate revision by one other user not shown)
Line 15: Line 15:
 
   |flagType
 
   |flagType
 
   |const char*
 
   |const char*
   |The flag code of the flag to give to the player. The flag code format is a string that looks like:
+
   |The flag code of the flag to give to the player.
* FLag (+FL)
+
Where letters that make up the flag abbreviation is capitalized. So for example, Narrow is Narrow and Wings is WinGs. The content in parenthesis are the actual parenthesis followed by the symbol of the flag. If no flag is being held, this parameter is simply an empty string.
+
 
   |-
 
   |-
 
   |force  
 
   |force  
Line 25: Line 23:
  
 
==Description==
 
==Description==
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 paramater is false, and the player has a flag, no action will be taken.
+
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.

Latest revision as of 22:52, 25 November 2016

BZFS API Documentation This page contains part of the BZFS API documentation for use by Plug-ins on the BZFS server.
BZFS API Function. This page documents a BZFS_API Function, that is provided by the BZFS game server for plug-ins to call.

Prototype[edit]

BZF_API bool bz_givePlayerFlag ( int playerID, const char* flagType, bool force );

Parameters[edit]

name type value desription
playerId int the player that is to get the flag.
flagType const char* The flag code of the flag to give to the player.
force bool replace the existing flag if it exists

Description[edit]

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.