Checkpoint Problem
#1

So.. I tried to make the sweeper job..
I go into a sweeper.. do /startsweep, go to the first checkpoints.. screen says: checkpoint 1/16
i go to the next checkpoint and it says: 15/16
and the next checkpoint is the "finish"

here is the code..
Код:
#define Sweeper1 -2430.1355,2291.4211,4.9844
#define Sweeper2 -2430.2937,2332.5701,4.8359
#define Sweeper3 -2333.4543,2379.6184,5.7352
#define Sweeper4 -2410.5444,2436.4761,11.8267
#define Sweeper5 -2435.3887,2474.2363,13.7891
#define Sweeper6 -2395.5596,2482.8215,10.4479
#define Sweeper7 -2413.8694,2500.8521,12.6690
#define Sweeper8 -2461.0054,2525.1477,16.8048
#define Sweeper9 -2485.2878,2476.7725,18.0479
#define Sweeper10 -2436.3071,2445.7068,13.7866
#define Sweeper11 -2502.8738,2424.3867,16.5976
#define Sweeper12 -2608.9709,2429.2698,14.7148
#define Sweeper13 -2617.0051,2290.8430,8.1715
#define Sweeper14 -2549.5854,2328.5842,4.8281
#define Sweeper15 -2431.7339,2319.3931,4.9844
#define Sweeper16 -2432.9648,2277.4175,4.9844

    public OnPlayerEnterCheckpoint(playerid)
    {
    if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 574)
       {
         if (IsPlayerInRangeOfPoint(playerid, 7.0, Sweeper1))
         {
              SetPlayerCheckpoint(playerid, Sweeper2, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 1/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper2))
         {
              SetPlayerCheckpoint(playerid, Sweeper3, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 2/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper3))
         {
              SetPlayerCheckpoint(playerid, Sweeper4, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 3/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper4))
         {
              SetPlayerCheckpoint(playerid, Sweeper5, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 4/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper5))
         {
              SetPlayerCheckpoint(playerid, Sweeper6, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 5/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper6))
         {
              SetPlayerCheckpoint(playerid, Sweeper7, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 6/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper7))
         {
              SetPlayerCheckpoint(playerid, Sweeper8, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 7/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper8))
         {
              SetPlayerCheckpoint(playerid, Sweeper9, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 8/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper9))
         {
              SetPlayerCheckpoint(playerid, Sweeper10, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 9/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper10))
         {
              SetPlayerCheckpoint(playerid, Sweeper11, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 10/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper11))
         {
              SetPlayerCheckpoint(playerid, Sweeper12, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 11/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper12))
         {
              SetPlayerCheckpoint(playerid, Sweeper13, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 12/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper13))
         {
              SetPlayerCheckpoint(playerid, Sweeper14, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 13/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper14))
         {
              SetPlayerCheckpoint(playerid, Sweeper15, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 14/16", 3000, 3);
             }
         if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper15))
         {
              SetPlayerCheckpoint(playerid, Sweeper16, 7.0);
              GameTextForPlayer(playerid, "~y~ Checkpoint 15/16", 3000, 3);
             }
		 if (IsPlayerInRangeOfPoint(playerid, 7.0,Sweeper16))
         {
             GivePlayerMoney(playerid, 250);
                 GameTextForPlayer(playerid, "~y~You finished the job, you earned 250,-$", 3000, 3);
             new veh;
             veh = GetPlayerVehicleID(playerid);
             SetVehicleToRespawn(veh);
             DisablePlayerCheckpoint(playerid);
             sweeperjob = 0;
         }
       }
    }
Reply
#2

Код:
if
then

Код:
else if
Might help m8'y, give it a try.
Reply
#3

point 2 and point 15 are quite near to each other... maybe just try it with a variable..
like:
pawn Код:
new SweeperMission[MAX_PLAYERS];
and where the mission starts:
pawn Код:
SweeperMission[playerid] = 1;
then on the checkpoints instead the "IsPlayerInRangeOfPoint"
pawn Код:
if(SweeperMission[playerid] == 1)
{
    SweeperMission[playerid]++;
    NextCheckpoint
}
Reply
#4

Quote:
Originally Posted by Sascha
Посмотреть сообщение
point 2 and point 15 are quite near to each other... maybe just try it with a variable..
like:
pawn Код:
new SweeperMission[MAX_PLAYERS];
and where the mission starts:
pawn Код:
SweeperMission[playerid] = 1;
then on the checkpoints instead the "IsPlayerInRangeOfPoint"
pawn Код:
if(SweeperMission[playerid] == 1)
{
    SweeperMission[playerid]++;
    NextCheckpoint
}
Thats a good point too.
Reply
#5

Quote:
Originally Posted by Stigg
Посмотреть сообщение
Код:
if
then

Код:
else if
Might help m8'y, give it a try.
It works, Thank you!
Reply
#6

Quote:
Originally Posted by Stefans94
Посмотреть сообщение
It works, Thank you!
No prob's glad i could help.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)