NPC ID - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: NPC ID (
/showthread.php?tid=201092)
NPC ID -
BlueKenny - 20.12.2010
How can i find the npc id?
Re: NPC ID -
TopAz07 - 20.12.2010
in wiki
Re: NPC ID - rjjj - 20.12.2010
When you start the server the NPC is the first that connect in it, so if you added only one NPC, the ID of this will be ID 0.
I did a command that can help you:
pawn Код:
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;
}
I hope that i have helped
Re: NPC ID -
Rachael - 20.12.2010
pawn Код:
public OnPlayerConnect(playerid)
{
if(IsPlayerNPC(playerid))
{
printf("NPC connected: id %d",playerid);
}
return 1;
}
AW: NPC ID -
BlueKenny - 20.12.2010
Thank you