SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help > Help Archive

 
 
Thread Tools Display Modes
Old 07/03/2011, 10:04 AM   #1
Stefans94
Big Clucker
 
Join Date: Nov 2010
Posts: 77
Reputation: 0
Default Checkpoint Problem

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..
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;
         }
       }
    }
Stefans94 is offline  
Old 07/03/2011, 10:08 AM   #2
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,084
Reputation: 111
Default Re: Checkpoint Problem

Code:
if
then

Code:
else if
Might help m8'y, give it a try.
__________________

Peace...

Stigg is offline  
Old 07/03/2011, 10:09 AM   #3
Sascha
High-roller
 
Sascha's Avatar
 
Join Date: Jul 2009
Location: Germany
Posts: 1,285
Reputation: 57
Default Re: Checkpoint Problem

point 2 and point 15 are quite near to each other... maybe just try it with a variable..
like:
pawn Code:
new SweeperMission[MAX_PLAYERS];
and where the mission starts:
pawn Code:
SweeperMission[playerid] = 1;
then on the checkpoints instead the "IsPlayerInRangeOfPoint"
pawn Code:
if(SweeperMission[playerid] == 1)
{
    SweeperMission[playerid]++;
    NextCheckpoint
}
__________________
Filterscripts
Sgt's Driving License - Sgt's Debug - Sgt's RCON Addition - IpCheck - Advertisement
Includes
Sgt's Vehicle Functions
Functions
IsFloat


Searching for a Partner/Admin/Mapper for an aviation server! Send me a PM if you are interested!
Sascha is offline  
Old 07/03/2011, 10:14 AM   #4
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,084
Reputation: 111
Default Re: Checkpoint Problem

Quote:
Originally Posted by Sascha View Post
point 2 and point 15 are quite near to each other... maybe just try it with a variable..
like:
pawn Code:
new SweeperMission[MAX_PLAYERS];
and where the mission starts:
pawn Code:
SweeperMission[playerid] = 1;
then on the checkpoints instead the "IsPlayerInRangeOfPoint"
pawn Code:
if(SweeperMission[playerid] == 1)
{
    SweeperMission[playerid]++;
    NextCheckpoint
}
Thats a good point too.
__________________

Peace...

Stigg is offline  
Old 07/03/2011, 10:17 AM   #5
Stefans94
Big Clucker
 
Join Date: Nov 2010
Posts: 77
Reputation: 0
Default Re: Checkpoint Problem

Quote:
Originally Posted by Stigg View Post
Code:
if
then

Code:
else if
Might help m8'y, give it a try.
It works, Thank you!
Stefans94 is offline  
Old 07/03/2011, 10:17 AM   #6
Stigg
High-roller
 
Stigg's Avatar
 
Join Date: Aug 2010
Location: Other side of the Universe.
Posts: 2,084
Reputation: 111
Default Re: Checkpoint Problem

Quote:
Originally Posted by Stefans94 View Post
It works, Thank you!
No prob's glad i could help.
__________________

Peace...

Stigg is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkpoint problem Sascha Help Archive 3 04/03/2011 10:35 AM
checkpoint problem hadzx Help Archive 2 25/01/2011 08:28 PM
Checkpoint problem?? -Rebel Son- Help Archive 4 25/01/2010 12:58 AM
CheckPoint Problem Onyx09 Help Archive 1 21/01/2010 01:20 AM
problem with checkpoint Pawno_Master Help Archive 18 04/07/2009 12:05 PM


All times are GMT. The time now is 05:14 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.