OnPlayerLeaveCeckpoint dont work !
#1

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;
}
Reply
#2

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

Reply
#3

Why not use the OnPlayerLeaveDynamicCP?
Reply
#4

OnPlayerEnterCheckpoint works?
Reply
#5

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

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?)
Reply
#7

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.
Reply
#8

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;
    }
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)