This function returns the number of checkpoints in the server. If the optional player argument is used, the function will return how many client-side checkpoints does the given player have. Without the argument it will return the number of global checkpoints.
- int GetCheckpointCount( [ Player plr ] )
- plr - If you want to get the number of local checkpoints for a specific client, use this argument to indicate the player. If you don't use this argument the global checkpoint count will be returned
This example command returns the count of checkpoints ingame (global and local checkpoints).
- function onPlayerCommand( player, command, text )
- if ( command == "checkpoints" )
- local checkpoints = GetCheckpointCount();
- local PlrCheckpoints = GetCheckpointCount( player );
- MessagePlayer( "There are currently " + checkpoints + " global checkpoints in-game.", player );
- MessagePlayer( "There are also " + PlrCheckpoints + " checkpoints which belong to you!", player );
- return 1;