Truck Driver REALLY NEEDED
#1

any ideas how to do that when someone enters a truck and attaches a trailer, he gets an checkpoint and when he reaches he gets a checkpoint back to the place he started at. When he gets to the 2nd checkpoint the trailer will deatach and he will get money

any ideas ?? plz help i really need this
Reply
#2

i need it too
Reply
#3

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
Reply
#4

Quote:
Originally Posted by ►►►Peter Corneile◄◄◄
if(IsPlayerInVehicle(playerid, 462)) //This id should be changed to your truck's model id ...
nope it should be the vehicle id.
if u dunno it then create a new truck like
truck = CreateVehicle(..blah..);
or
truck = AddStaticVehicleVehicle(..blah..);

truck = the vehicleid then then u can do
if(IsPlayerInVehicle(playerid, truck))

didnt check the rest tho but it looks wrong too..
didnt check exactly.
Reply
#5

I know but i showed this just as an example and the trucks cant be used for any other purpose either i think .. And all the vehicles of that modelid (trucks) will be at the Trucker's place so it should be ok

And your way can be used too
Reply
#6

please give an example of what should appear filled with trucks and coordinates
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)