IsPlayerConnected

From SA-MP

Jump to: navigation, search


IsPlayerConnected

This function can be used to check if a player is connected to the server via SA:MP.


(playerid)
playeridThe 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
	}
}

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.
Personal tools
In other languages