IsPlayerConnected
From SA-MP
[edit]
IsPlayerConnected
This function can be used to check if a player is connected to the server via SA:MP.
(playerid)
| playerid | The playerid you would like to check. |
Returns true if the player is connected and false if the player is not.
loopPlayers() { for(new playerid = 0, mP = GetMaxPlayers(); playerid < mP; playerid++) { if (!IsPlayerConnected( playerid )) continue; // Other code here } }
[edit]
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.
- SendRconCommand: Send a message to the Rcon-console of the server from your script.
- IsPlayerAdmin: Checks if a specific player, specified by their ID, is an RCON-admin.
- SetVehicleParamsForPlayer: Lock a vehicle's doors, for admin-vehicles for example.
