warning Not Translated
This page has not been translated into the language that your browser requested yet. The English content is being shown as a fallback.
If you want to contribute a translation for this page then please click here.
IsPlayerConnected
Description
Checks if a player is connected (if an ID is taken by a connected player).
Name | Description |
---|---|
playerid | The ID of the player to check. |
Returns
true - Player is connected.
false - Player is NOT connected.
Examples
KillPlayer(playerid)
{
if (!IsPlayerConnected(playerid))
{
printf("Player ID %i is not connected!", playerid);
}
else
{
SetPlayerHealth(playerid, 0.0);
}
}
Notes
tip
This function can be omitted in a lot of cases. Many other functions already have some sort of connection check built in.
Related Functions
- IsPlayerAdmin: Checks if a player is logged into RCON.
Related Callbacks
- OnPlayerConnect: Called when a player connects to the server.
- OnPlayerDisconnect: Called when a player leaves the server.