18.07.2012, 17:27
How do i kick an NPC in OnFilterScriptExit()?
And not all NPC's but one.
And not all NPC's but one.
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;
}