Problem with checkpoints!
#1

I have scripted a sweeper job, the first checkpoins shows up but the second and third not.

The CMD:

pawn Код:
if(strcmp(cmd, "/startsweeping", true) == 0)
    {
        new tmpcar = GetPlayerVehicleID(playerid);
        if(PlayerInfo[playerid][pJob] == 2)
        {
            if(Sweeping[playerid] == 0)
            {
                if(IsASweepingCar(tmpcar))
                {
                    SendClientMessage(playerid, COLOR_LIGHTBLUE, "You can now start sweeping.");
                    CP[playerid] = 1;
                    Sweeping[playerid] = 1;
                    SetPlayerCheckpoint(playerid, 2140.5813,-2115.7019,13.2051, 5);
                    return 1;
                }
                else
                {
                    SendClientMessage(playerid, COLOR_CREAM, "You are not in a street sweeping car.");
                    return 1;
                }
            }
            else
            {
                SendClientMessage(playerid, COLOR_CREAM, "You are already sweeping.");
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid, COLOR_CREAM, "You are not a street sweeper.");
            return 1;
        }
    }

public OnPlayerEnterCheckpoint:

pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    new pveh = GetPlayerVehicleID(playerid);
    if(CP[playerid]==1)
    {
        if(IsASweepingCar(pveh) && Sweeping[playerid] == 1)
        {
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, 1987.5314,-2108.5859,13.1661, 5);
            CP[playerid] = 2;
            GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
            SafeGivePlayerMoney(playerid, 50);
            Sweeping[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
        }
    }
    else if(CP[playerid]==2 && Sweeping[playerid] == 1)
    {
        if(IsASweepingCar(pveh))
        {
            SetPlayerCheckpoint(playerid, 2045.5214,-1935.0801,13.1432, 5);
            CP[playerid] = 3;
            GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
            SafeGivePlayerMoney(playerid, 50);
            Sweeping[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
        }
    }
    else if(CP[playerid]==3 && Sweeping[playerid] == 1)
    {
        if(IsASweepingCar(pveh))
        {
            DisablePlayerCheckpoint(playerid);
            SetPlayerCheckpoint(playerid, 2083.7595,-1831.7170,13.2008, 5);
            CP[playerid] = 4;
            GameTextForPlayer(playerid, "~g~+$50", 2000, 3);
            SafeGivePlayerMoney(playerid, 50);
            Sweeping[playerid] = 1;
        }
        else
        {
            SendClientMessage(playerid, COLOR_GREY, "You are not in a sweeper.");
        }
    }
    return 1;
}
Reply
#2

Show the whole OnPlayerEnterCheckpoint callback.
Reply
#3

I've put the whole OnPlayerEnterCheckpoint.

Can anyone help please?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)