IsPlayerNPC

warning

This function was added in SA-MP 0.3a and will not work in earlier versions!

Description

Check if a player is an actual player or an NPC.

NameDescription
playeridThe ID of the player to check.

Returns

1: The player is an NPC.

0: The player is not an NPC.

Examples

public OnPlayerConnect(playerid)
{
if (IsPlayerNPC(playerid))
{
SendClientMessageToAll(-1, "An NPC connected!");
return 1;
}
// The other code here won't be executed unless its a player
}

Related Functions