[Tutorial] Checkpoint system
#1

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 код:
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 код:
new Tutorialcheckpoint[20]; 
so now you have to write under OnPlayerEnterCheckpoint:
PHP код:
{
    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;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)