NPC does not get kicked
#1

Heey guys

I am busy with fun stuff for NPC.
Now I want that when a npc enters a racecheckpoint that he gets kicked and the car gets removed.

Now the car gets removed, but the NPC does not gets kicked
This is my code:
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,20,2432.2124,1128.8608,10.6719))
    {
        DestroyVehicle(Taxi1);
        new npcname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, npcname, sizeof(npcname));
        if(IsPlayerNPC(playerid))
        {
            if(!strcmp(npcname, "NPC6", true))
            {
                Kick(playerid);
            }
        }
    }
    return 1;
}
Thanks
Reply
#2

So the playerid == the id of the NPC?
Reply
#3

Well I think so, how should I do that otherwise?
Reply
#4

Shall controllable NPC help?
Reply
#5

Add the on

OnPlayerSpawn
{
if(IsPlayerNPC(playerid))
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)