Squirrel/Functions/Server/GetPlayers
From VC-MP Wiki
This returns the ammount of players currently in the server
Syntax
int GetPlayers()
Arguments
- None
Example
This example will return amount of players currently ingame when a player types '/c players'.
function onPlayerCommand( player, cmd, text ) { if ( cmd == "players" ) { MessagePlayer( "Players online: " + GetPlayers() + "/" + GetMaxPlayers(), player ); } }
Notes
The function MessagePlayer and call onPlayerCommand were used in in this example. More info about them in corresponding pages.
Related Functions
- GetServerName
- SetServerName
- GetGamemodeName
- SetGamemodeName
- GetMapName
- SetMapName
- GetPassword
- SetPassword
- GetMaxPlayers
- SetMaxPlayers
- GetPlayers
- GetDeathmatchScoreBoard
- SetDeathmatchScoreBoard
- GetDeathMessages
- SetDeathMessages
- GetDrivebyEnabled
- SetDrivebyEnabled
- GetFallEnabled
- SetFallEnabled
- GetDriveOnWater
- SetDriveOnWater
- GetFlyingCars
- SetFlyingCars
- GetTaxiBoostJump
- SetTaxiBoostJump
- SetWeaponDamage
- GetSkinEnabledForPlayer
- SetSkinEnabledForPlayer
