SA-MP Forums Archive
Checkpoint not disabling? - 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)
+--- Thread: Checkpoint not disabling? (/showthread.php?tid=448300)



Checkpoint not disabling? - Rokzlive - 03.07.2013

For some reason, the checkpoints in my mission system are not disabling. The one under the mInfo[playerid][CID] == 1 disables and reassigns fine, but under the mInfo[playerid][CID] == 2 it calls everything there but doesnt disable the checkpoint.

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(mInfo[playerid][CID] == 1)
    {
        if(!CheckOriginalVehicles(playerid)) return 0;
        DisablePlayerCheckpoint(mInfo[playerid][Checkpoint]);
        new String[200];
        format(String,sizeof(String),"Deliver the %s to %s",mInfo[playerid][Load],mInfo[playerid][LName]);
        SendClientMessage(playerid,COLOR_YELLOW,String);
        mInfo[playerid][Checkpoint] = SetPlayerCheckpoint(playerid,mInfo[playerid][Lx],mInfo[playerid][Ly],mInfo[playerid][Lz], 7.0); mInfo[playerid][CID] = 2;
    }
    else if(mInfo[playerid][CID] == 2)
    {
        if(!CheckOriginalVehicles(playerid)) return 0;
        DisablePlayerCheckpoint(mInfo[playerid][Checkpoint]);
        new String[200];
        new name[MAX_PLAYER_NAME];
        GetPlayerName(playerid, name, sizeof(name));
        format(String,sizeof(String),"%s delivered %s From %s To %s",name,mInfo[playerid][Load],mInfo[playerid][FName],mInfo[playerid][LName]);
        SendClientMessageToAll(COLOR_GREEN,String);
        format(String,sizeof(String),"You have earned %d for working!",mInfo[playerid][Pay]);
        SendClientMessage(playerid,COLOR_GREEN,String);
        AddPlayerMoney(playerid,mInfo[playerid][Pay]);
        AddPlayerScore(playerid,1);
        mInfo[playerid][CID] = 0;
    }
    return 1;
}



Re: Checkpoint not disabling? - Zigonja - 03.07.2013

Try deleting DisableCheckpoints, because I belive that checkpoint gets removed when you enter it.
I mean it worked for me


Re: Checkpoint not disabling? - shadowdog - 03.07.2013

Try changin this
pawn Код:
DisablePlayerCheckpoint(mInfo[playerid][Checkpoint]);
To
pawn Код:
DisablePlayerCheckpoint(playerid);
On both those disables