10.11.2010, 13:24
pawn Код:
forward KickNPCOnPoint();
new npcdrifttimer;
public OnFilterScriptInit() // or OnGameModeInit
{
npcdrifttimer = SetTimer("KickNPCOnPoint", 1000, 1);
return 1;
}
public OnFilterScriptExit() // or OnGameModeExit
{
KillTimer(npcdrifttimer);
}
public KickNPCOnPoint()
{
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerToPoint(5.0,i,coordonates)) // Change with your coordonates where you want the NPC to be kicked
{
if(IsPlayerNPC(i))
{
new npcname[MAX_PLAYER_NAME];
GetPlayerName(i, npcname, sizeof(npcname)); //Getting the NPC's name.
if(!strcmp(npcname, "npc_name", true)) //Checking if the NPC's name is ....
{
Kick(i);
}
}
}
}
}
return 1;
}
I didn't test it ...