18.03.2013, 17:52
This is just a guess, but maybe it works when you use a stock function, I've made this real quickly.
Send the NPC's name to this function, and you'll get the id (not tested).
It would be like
It should work.
pawn Code:
stock GetNPCID(name[])
{
for(new i=0; i < MAX_PLAYERS; i++)
{
if(IsPlayerNPC(i))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(i,npcname,MAX_PLAYER_NAME);
if(strcmp(name,npcname,true) == 0)
{
return i;
}
}
}
}
It would be like
pawn Code:
new npcid = GetNPCID("Zombie");
SetPlayerPos(npcid,x,y,z);