Checkpoint when enter vehicle
#1

How to assign a uniqe checkpoint to a car?
and when I enter another car an new checkpoint will appear but in a diffrent place?

And under which public should I use this?

I have done this so far new Truck1 = AddStaticVehicle(515, ...,...,...);
What next?
Reply
#2

I'm not sure if I get you or not but if I do...here's what I think is the way to do it.

pawn Код:
#define TruckCheckPoint 1605.4689,-2493.7014,13.5547
This will be at the top define different checkpoints. You can add as many as you like.

pawn Код:
}
public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
     {
         SetPlayerCheckpoint(playerid, TruckCheckPoint, 3.0);
     }
     return 0;
}
When entering a truck (ID-515), you will enable a checkpoint for that player which was defined above.

pawn Код:
public OnPlayerExitVehicle(playerid, vehicleid)
{
     if(GetVehicleModel(GetPlayerVehicleID(playerid)) == 515)
     {
         DisablePlayerCheckpoint(playerid);
     }
     return 0;
}
On exiting the truck, you will disable the checkpoint.

I hope this helped.
Reply
#3

Ah, Im gonna try that out! Thanks man!
Reply
#4

And Also I want to have a Uniqe Checkpoint for each truck? How to?
Reply
#5

You're welcome. Now regarding the unique checkpoint for each truck,
I think you'll have to do what you mentioned in your original post.

pawn Код:
Truck1 = AddStaticVehicle(515, ...,...,...);
and
pawn Код:
if(GetVehicleModel(GetPlayerVehicleID(playerid)) == Truck1)
Haven't tested it out myself but it should work.
Good Luck!

Edit:
You will probably have to add the below at the top section of your gamemode/FS.
pawn Код:
new truck1;
Reply
#6

nvm, I had done this completley wrong :P I've solved it!

Thanks for all reply's! +rep for you guys!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)