20.12.2010, 10:33
How can i find the npc id?
if(strcmp("/npcinfo", cmdtext, true, 7) == 0)
{
new string[128];
new name[MAX_PLAYER_NAME];
SendClientMessage(playerid, 0x33AA33AA, "NPC Information:");
for(new x = 0; x < MAX_PLAYERS; x++)
{
if(IsPlayerNPC(x))
{
GetPlayerName(x, name, sizeof(name));
format(string, sizeof(string), "Name: %s. ID: %d", name, x);
SendClientMessage(playerid, 0xFFFF00AA, string);
}
}
return 1;
}
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
printf("NPC connected: id %d",playerid);
}
return 1;
}