On top of your script
pawn Код:
new TruckCheckpoint[MAX_PLAYERS];
pawn Код:
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
if(IsPlayerInVehicle(playerid, 462)) //This id should be changed to your truck's model id ...
{
AttachTrailerToVehicle(5,1); //change the one to the id of your truck
SetPlayerRaceCheckpoint(playerid, 0, x,y,z,nextx,nexty,nextz, 5.0);
TruckCheckpoint[playerid] = 1;
}
return 1;
}
pawn Код:
public OnPlayerEnterRaceCheckpoint(playerid)
{
DisablePlayerRaceCheckpoint(playerid);
if(TruckCheckpoint[playerid] == 1)
{
SetPlayerRaceCheckpoint(playerid, 0, x,y,z, xnext,ynext,znext, 5.0);// First Checkpoint and the place to reach
TruckCheckpoint[playerid] = 2; // NEXT CP
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
}
else if(TruckCheckpoint[playerid] == 2)
{
SetPlayerRaceCheckpoint(playerid, 0, x,y,z, xnext,ynext,znext, 5.0);//Second checkpoint and the back where you started
TruckCheckpoint = 3; // NEXT CP
PlayerPlaySound(playerid, 1057, 0.0, 0.0, 0.0);
GivePlayerMoney(playerid,1000);
SendClientMessage(playerid,color,"Good Job");
}
return 1;
}
Not Tested yet