IsPlayerConnected

Description

Checks if a player is connected (if an ID is taken by a connected player).

NameDescription
playeridThe ID of the player to check.

Returns

0: Player is NOT connected.

1: Player IS connected.

Examples

KillPlayer(playerid)
{
if (!IsPlayerConnected(playerid))
{
printf("Player ID %i is not connected!", playerid);
}
else
{
SetPlayerHealth(playerid, 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