Squirrel/Server/Functions/Blips/GetBlipCount
From Liberty Unleashed Wiki
(Difference between revisions)
(Created page with '{{Squirrel/Title|GetBlipCount}} This function returns the number of created radar blips. If the optional player argument is used, the function will return how many client-side bl…') |
m (moved Squirrel/Functions/Blips/GetBlipCount to Squirrel/Server/Functions/Blips/GetBlipCount: Server-side function) |
Latest revision as of 19:08, 24 September 2010
This function returns the number of created radar blips. If the optional player argument is used, the function will return how many client-side blips does the given player have. Without the argument it will return the number of global blips.
[edit] Syntax
int GetBlipCount( [ Player plr ] )
[edit] Arguments
- plr - If you want to get the number of the blips for a specific client, use this argument to indicate the player. If you don't use this argument the global blip count will be returned
[edit] Example
This example command returns the number of blips ingame (global and local blips) when a player types '/blips'.
function onPlayerCommand( player, command, text ) { if ( command == "blips" ) { local blips = GetBlipCount(); local localBlips = GetBlipCount( player ); MessagePlayer( "There are currently " + blips + " global blips shown on the radar.", player ); MessagePlayer( "There are also " + localBlips + " local blips which only you can see.", player ); } return 1; }
[edit] Notes
The function MessagePlayer and event onPlayerCommand were used in in this example. More info about them in the corresponding pages.