NPC ID
#1

How can i find the npc id?
Reply
#2

in wiki
Reply
#3

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
Reply
#4

pawn Код:
public OnPlayerConnect(playerid)
{
     if(IsPlayerNPC(playerid))
     {
          printf("NPC connected: id %d",playerid);
     }
     return 1;
}
Reply
#5

Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)