SA-MP Forums Archive
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)
+--- Thread: NPC ID (/showthread.php?tid=389342)



NPC ID - Virus. - 01.11.2012

Hey guys, Is it possible to create a NPC which has a ID, so I can test some scripts.


Re: NPC ID - Niko_boy - 01.11.2012

each NPC has a ID like every player has .. they just dont show up in [TAB] or any server player list


Re: NPC ID - niels44 - 01.11.2012

use onplayerspawn or connect:

pawn Код:
new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(!strcmp(npcname, "yourbotnamehere", true))
        {
            yourbotnamevariable = playerid;
            return 1;
        }
that should work, change the botnamevariable to your botvariable, and the name to your bot name