Damn checkpoints.
#1

Having trouble with the checkpoints, the first one shows up but after i went into it the second doesen't.



pawn Код:
CMD:sweep(playerid, params[])
{
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You need to login first before using any command.");
    if(PlayerInfo[playerid][pJob] != JOB_SWEEPER && PlayerInfo[playerid][pVIPJob] != JOB_SWEEPER) return SendClientMessage(playerid, COLOR_GREY, "ERROR: You are not a Street Sweeper.");
    if(PlayerIsSweeping[playerid] == 1) return SCM(playerid, COLOR_GREY, "ERROR: You are already sweeping, if you want to stop type /stopsweep.");
    if(!IsSweeperVehicle(GetPlayerVehicleID(playerid))) return SCM(playerid, GREY, "ERROR: You are not in a street sweeper.");
    PlayerIsSweeping[playerid] = 1;
    SetPlayerCheckpoint(playerid,2552.9089,-1463.7263,23.84907,5);
    SendClientMessage(playerid, COLOR_WHITE, "Sweeper Bureau: Drive true the red checkpoints to clean the streets.");
    return 1;
}
pawn Код:
if(PlayerIsSweeping[playerid] == 1)
    {
        new veh = GetPlayerVehicleID(playerid);
        if(IsPlayerInAnyVehicle(playerid))
        {
            if(IsSweeperVehicle(veh))
            {
                if(IsPlayerInRangeOfPoint(playerid,5,2552.9089,-1463.7263,23.84907)) // Checkpoint 1
                {
                    SetPlayerCheckpoint(playerid,2573.5674,-1379.2954,30.6008,5); //
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2573.5674,-1379.2954,30.6008)) // Checkpoint 2
                {
                    SetPlayerCheckpoint(playerid,2720.1606,-1527.5421,29.2350,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2720.3054,-1322.7209,49.7487)) // Checkpoint 3
                {
                    SetPlayerCheckpoint(playerid,2645.4248,-1633.9985,10.7204,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2645.4248,-1633.9985,10.7204)) // Checkpoint 4
                {
                    SetPlayerCheckpoint(playerid,2623.3582,-1441.6207,31.3220,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2623.3582,-1441.6207,31.3220)) // Checkpoint 5
                {
                    SetPlayerCheckpoint(playerid,2545.0110,-1442.0045,32.4281,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2545.0110,-1442.0045,32.4281)) // Checkpoint 6
                {
                    SetPlayerCheckpoint(playerid,2468.3027,-1441.9670,24.4141,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2468.3027,-1441.9670,24.4141)) // Checkpoint 7
                {
                    SetPlayerCheckpoint(playerid,2448.7842,-1461.2600,24.0000,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2448.7842,-1461.2600,24.0000)) // Checkpoint 8
                {
                    SetPlayerCheckpoint(playerid,2521.4592,-1464.1672,23.9719,5);
                }
                else if(IsPlayerInRangeOfPoint(playerid,5,2521.4592,-1464.1672,23.9719)) // Checkpoint 9
                {
                    PlayerIsSweeping[playerid] = 0;
                    GiveZaiatMoney(playerid, 250);
                    SCM(playerid, WHITE, "Sweeper Bureau: Thank you for cleaning the streets, you have earned $250.");
                }
            }
        }
    }
Reply
#2

Use this callback.
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    return 
1;//hope you know how to use it.

Reply
#3

Quote:
Originally Posted by TaLhA XIV
Посмотреть сообщение
Use this callback.
PHP код:
public OnPlayerEnterCheckpoint(playerid)
{
    return 
1;//hope you know how to use it.

Thank you kind sir.
Reply
#4

Nah,no problem.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)