SA-MP Forums Archive
OnPlayerLeaveCeckpoint dont work ! - 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: OnPlayerLeaveCeckpoint dont work ! (/showthread.php?tid=605248)



OnPlayerLeaveCeckpoint dont work ! - MRM - 16.04.2016

Hello.
Only for one, does not work.
Is there any problem ?
pawn Код:
new CP_Train;
CP_Train = CreateDynamicCP(-1972.4688,117.8655,27.6940,2,-1,-1,-1,30.0);
public OnPlayerLeaveDynamicCP(playerid , checkpointid)
{
    if(checkpointid == CP_Train)
    {
            SendClientMessage(playerid,COLOR_ERROR,"Test");
        if(RobbingTrain[playerid] >= 1)
        {
            SendClientMessage(playerid,COLOR_ERROR,"Failed.");
            RobbingTrain[playerid] =0;
            return 1;
        }
        return 1;
    }
    return 1;
}



Re: OnPlayerLeaveCeckpoint dont work ! - Prokill911 - 16.04.2016

You could just do
IsPlayerInRangeOfPoint
PHP код:
if(!IsPlayerInRangeOfPoint(playerid15.0,-1972.4688,117.8655,27.6940)) {
blahblah




Re: OnPlayerLeaveCeckpoint dont work ! - MRM - 16.04.2016

Why not use the OnPlayerLeaveDynamicCP?


Re: OnPlayerLeaveCeckpoint dont work ! - ScIrUsna - 16.04.2016

OnPlayerEnterCheckpoint works?


Re: OnPlayerLeaveCeckpoint dont work ! - MRM - 16.04.2016

Quote:
Originally Posted by ScIrUsna
Посмотреть сообщение
OnPlayerEnterCheckpoint works?
yes.


Re: OnPlayerLeaveCeckpoint dont work ! - NaS - 16.04.2016

Is OnPlayerLeaveCheckpoint (SAMP Callback) called when you exit it/any other CP?
If yes, it should be a streamer problem (eventually a return 0 in some other script?)


Re: OnPlayerLeaveCeckpoint dont work ! - MRM - 17.04.2016

Quote:
Originally Posted by NaS
Посмотреть сообщение
Is OnPlayerLeaveCheckpoint (SAMP Callback) called when you exit it/any other CP?
If yes, it should be a streamer problem (eventually a return 0 in some other script?)
My OnPlayerLeaveCheckpoint :
pawn Код:
public OnPlayerLeaveCheckpoint(playerid)
{
    return 1;
}
No,
All my script is steamer. But SetPlayerAttachedObject.


Re: OnPlayerLeaveCeckpoint dont work ! - MRM - 17.04.2016

Solved.

Код:
%How to fix it?
The problem is the following code:
pawn Код:
if(checkpointid == CheckPoint1 || CheckPoint2)
    {
        SendClientMessage(playerid,0xF5551FFF,"Test");
        return 1;
    }
Convert To:
pawn Код:
if(checkpointid == CheckPoint1)
    {
        SendClientMessage(playerid,0xF5551FFF,"Test");
        return 1;
    }
    if(checkpointid == CheckPoint2)
    {
        SendClientMessage(playerid,0xF5551FFF,"Test");
        return 1;
    }

% OR

    if(checkpointid == CheckPoint1 || checkpointid == CheckPoint2)
    {
        SendClientMessage(playerid,0xF5551FFF,"Test");
        return 1;
    }