SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 22/02/2013, 01:09 PM   #1
lcp9
Little Clucker
 
Join Date: Feb 2013
Posts: 29
Reputation: 1
Default Checkpoint system

Hey guys i want to show you how to make a checkpoint system i mean you must drive from One Checkpoint to other
or more than two checkpoints:
first you have to make a cmd to set a checkpoint (if you want you can do it too if you enter vehicle etc...)
here is the cmd with ocmd (you can write it to other command przessorr iif you want!)
:
PHP Code:
ocmd:job(playerid,params[])
{
     if( 
GetVehicleModelGetPlayerVehicleIDplayerid ) ) != 515 &&
    
GetVehicleModelGetPlayerVehicleIDplayerid ) ) != 578  &&
    
GetVehicleModelGetPlayerVehicleIDplayerid ) ) != 455 )
//here you can write i  which vehicle to drive

    
return SendClientMessageplayerid0xFFFFFFFF"You Need to be in a Flatbed , Roadtrain or DFT30 to do this work!" );

    
Tutorialcheck[playerid] = 1;

    
SetPlayerCheckpoint(playerid,1363.5885,-1289.5168,13.5469,5.0);//here say where the driver have to drive at the 1st time
    
SendClientMessage(playerid,BLAU,"Drive to Ammushop 1 ");
    return 
1;


at the top you have to make this for the checkpoint:
PHP Code:
new Tutorialcheckpoint[20]; 
so now you have to write under OnPlayerEnterCheckpoint:
PHP Code:
{
    if(
Tutorialcheck[playerid] == 1)

    {
    
DisablePlayerCheckpoint(playerid);
    
Tutorialcheck[playerid] = 2;
    
SetPlayerCheckpoint(playerid1003.7125,-1356.2329,13.32465.0);//here say where the driver have to drive at the 2nd time
    
SendClientMessage(playerid,BLAU,"Drive to next checkpoint!");
    return 
1;
    }
    if(
Tutorialcheck[playerid] == 2)
    if(
IsPlayerInRangeOfPoint(playerid,7.0,1003.7125,-1356.2329,13.3246))
    {
    
DisablePlayerCheckpoint(playerid);
    
fuhrer[playerid] = 3;
    
SetPlayerCheckpoint(playerid238.5253,-44.6169,1.57815.0);//here say where the driver have to drive at the 3nd time
    
SendClientMessage(playerid,BLAU,"Drive to next checkpoint!");
    return 
1;
    }

    if(
Tutorialcheck[playerid] == 3)
    if(
IsPlayerInRangeOfPoint(playerid,7.0,238.5253,-44.6169,1.5781))
    {
    
DisablePlayerCheckpoint(playerid);
    
Tutorialcheck[playerid] = 0;
    
GivePlayerMoney(playerid, +30000);//money
    
SetPlayerScore(playeridGetPlayerScore(playerid) +1);//score
    
return 1;
    }

    }
    return 
0;


lcp9 is offline   Reply With Quote
Reply

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
[Include] And CheckPoint System v1.0 andmeida10 Includes 4 24/02/2012 07:48 AM
[HELP] Checkpoint system still buggy theinformer Scripting Help 0 27/12/2011 09:59 PM
Checkpoint System ColdXX Help Archive 11 14/10/2010 08:13 PM
[Include] [INC]Hidden CheckPoint System *Beta 0.2 mansonh Includes 18 10/05/2010 07:16 PM
Checkpoint system?? javind0 Help Archive 8 10/03/2009 07:38 PM


All times are GMT. The time now is 12:42 AM.


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