Race checkpoint doesn't get disabled
#1

Hi,

So I made a very simple command which enables a race checkpoint and disables when a player enters it. But when a player enters it, it doesn't get disabled. Here it is:

pawn Код:
CMD:approchls(playerid,params[])
{
    new Name[24], Msg[200];
    GetPlayerName(playerid, Name, sizeof(Name));
    SetPlayerRaceCheckpoint(playerid, 2, 1455.1359,-2593.3552,13.5469, 0, 0, 0, 12);
    SendClientMessage(playerid, red, "Bla bla shit");
    if(IsPlayerInRaceCheckpoint(playerid))
        DisablePlayerRaceCheckpoint(playerid);

    return 1;
}
I'm sure that I'm doing something wrong there. Can someone help me out?
Reply
#2

Try with that
pawn Код:
CMD:approchls(playerid,params[])
{
    new Name[24], Msg[200];
    GetPlayerName(playerid, Name, sizeof(Name));
    SetPlayerRaceCheckpoint(playerid, 2, 1455.1359,-2593.3552,13.5469, 0, 0, 0, 12);
    SendClientMessage(playerid, red, "Bla bla shit");
    if(IsPlayerInRaceCheckpoint(playerid))
    {
        DisablePlayerRaceCheckpoint(playerid);
    }
    return 1;
}
Reply
#3

Duh, this only works if the player types the command when he's in the checkpoint already. There is something called OnPlayerEnterRaceCheckpoint.
Reply
#4

Quote:
Originally Posted by Vince
Посмотреть сообщение
Duh, this only works if the player types the command when he's in the checkpoint already. There is something called OnPlayerEnterRaceCheckpoint.
Oh GOD. How stupid I was! Never thought of that. And thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)