GetPlayerPoolSize
From SA-MP Wiki
(Difference between revisions)
Revision as of 22:56, 5 March 2015 Drebin (Talk | contribs) ← Previous diff |
Revision as of 21:09, 27 May 2015 Vince (Talk | contribs) Next diff → |
||
Line 11: | Line 11: | ||
FreezeAll() | FreezeAll() | ||
{ | { | ||
- | for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) | + | for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) // note that we assign the return value to a new variable (j) to avoid calling the function with each iteration |
{ | { | ||
TogglePlayerControllable(i, 0); | TogglePlayerControllable(i, 0); |
Revision as of 21:09, 27 May 2015
Description:
Gets the highest playerid currently in use on the server.
This function has no parameters.
Return Values:
The highest playerid currently in use on the server.
Example Usage:
FreezeAll() { for(new i = 0, j = GetPlayerPoolSize(); i <= j; i++) // note that we assign the return value to a new variable (j) to avoid calling the function with each iteration { TogglePlayerControllable(i, 0); } }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- GetVehiclePoolSize: Gets the highest vehicleid currently in use on the server.
- GetMaxPlayers: Gets the maximum number of players that can join the server.