Checkpoint When Trailer Is Attached
#1

Hey! [SAP]Sidhu here.. I'm currently working on a new GM and I'm in need of some help.
How would I script the following:

I have 2 trailers, A and B. When either A or B get attached to any truck, a checkpoint appears at a certain spot in the game.

All help is greatly appreciated!
Reply
#2

i think you may use that for ur plans:

https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle

just paste it where you want it, and it actually should work, i hope =D
Then u just have to set the checkpoint.

Greetings, DeathOnaStick
Reply
#3

Quote:
Originally Posted by DeathOnaStick
i think you may use that for ur plans:

https://sampwiki.blast.hk/wiki/IsTrailerAttachedToVehicle

just paste it where you want it, and it actually should work, i hope =D
Then u just have to set the checkpoint.

Greetings, DeathOnaStick
Lol. Thanks, but I knew that part :P

How would I tell it what trailer is it though?
Like if the trailer is trailer A or trailer B (specific trailers), THEN show the checkpoint, otherwise don't.
Reply
#4

What i would suggest it.
*anything in brackets is pawn*
(if)(vehicle model, is trailer attached)
{
checkpoint show?
return 1;
}
something like that, as i said in another scripting section, i have not done pawn in over 3 months so i cannot remember at all.
Reply
#5

Well, I did truckt1 = CreateVehicle..., where truckt1 = truck trailer 1.

Now, how do I take truckt1 and put it into code so it checks if truckt1, specifically, is attached to a truck? And if truckt1 is attached to a truck, THEN the checkpoint shows.
Reply
#6

Quite simple in fact...
pawn Code:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);

If(IsTrailerAttachedToVehicle(vehicleid) && GetVehicleTrailer(vehicleid) == truckt1)
{
  CODE TO DISPLAY CHECKPOINT FOR TRAILER A ATTACHED TO A TRUCK
}
Reply
#7

Quote:
Originally Posted by dougbrowne
Quite simple in fact...
pawn Code:
new vehicleid;
vehicleid = GetPlayerVehicleID(playerid);

If(IsTrailerAttachedToVehicle(vehicleid) && GetVehicleTrailer(vehicleid) == truckt1)
{
  CODE TO DISPLAY CHECKPOINT FOR TRAILER A ATTACHED TO A TRUCK
}
I shall try that. Thank you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)