Kicking an NPC
#1

How do i kick an NPC in OnFilterScriptExit()?
And not all NPC's but one.
Reply
#2

pawn Code:
public OnFilterScriptExit()
{
    new npcName[MAX_PLAYER_NAME];
    for(new i = 0; i < MAX_PLAYERS; i ++)
    {
        if(!IsPlayerNPC(i))
            continue;
        GetPlayerName(i, npcName, sizeof(npcName));
        if(!strcmp(npcName, "YourNPCNameHere", false)) // YourNPCNameHere is the name of your npc that you used in ConnectNPC.
        {
            // Other stuff
            Kick(i);
            break; // to break out of the loop when it finds your npc (Useful when you have many npces connected).
        }
    }
    return 1;
}
Reply
#3

Thanks!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)