SA-MP Forums Archive
One problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: One problem (/showthread.php?tid=271914)



One problem - marrcko - 26.07.2011

hi, i have one problem: i'm creating races with CP and @finish CP it should do this...Well, its working untill the winner is NPC...Even I lose im still get award.
BTW: this messege didn't show up.
pawn Код:
stock RaceStats(playerid)
    {
    if(IsPlayerNPC(playerid))
        {
        SendClientMessageToAll(RAUDONA,"win npc");
        for(new p=0; p<MAX_PLAYERS; p++)
            {
            new names[26];
            GetPlayerName(p,names,sizeof(names));
            if(!strcmp(names,"NPC_Racer"))
                {
                Kick(p);
                IsNPCWinner=true;
                IsNPCInRace=false;
                }
            }
        ConnectNPC("NPC_Racer","steady");
        return 1;
        }
    if(IsNPCWinner)
        {
        MissionFailed(playerid);
        IsNPCWinner=false;
        DisablePlayerRaceCheckpoint(playerid);
        }
    else
        {
        DisablePlayerRaceCheckpoint(playerid);
        GivePlayerMoney(playerid,10000);
        Mprogress6[playerid]=0;
        IsPlayerInMission[playerid] = 0;
        GameTextForPlayer(playerid,"~w~+10.000$",1500,5);
        MissionComplete(playerid);
        IsNPCWinner=false;
        IsNPCInRace=false;
        for(new p=0; p<MAX_PLAYERS; p++)
            {
            new names[26];
            GetPlayerName(p,names,sizeof(names));
            if(!strcmp(names,"NPC_Racer"))
                {
                Kick(p);
                }
            }
        ConnectNPC("NPC_Racer","steady");
        }
    return 1;
    }



Re: One problem - marrcko - 28.07.2011

***BUMBING***

BTW:i guessing that npc can't enter to CP? So maybe someone know how to do that?


Re: One problem - BMUK - 28.07.2011

OnPlayerEnterCheckpoint is called for NPC's