Keeping vehicle
#1

Hello

Is there a way to keep a vehicle on a back of another vehicle, eg. Sultan on the back of DFT.

Thanks.
Reply
#2

Yes there is a way.

Explanation:

Set the position of following vehicle to the position of the other vehicle's position (Just change Y pos)

Execution:

Код:
new VehicleFollow[MAX_VEHICLES]=-1;
//In a command:
VehicleFollow[VEHICLEID1] = [VEHICLEID2];
//In a timer:
new Float:Pos[3];
for(new i = 0; i <= MAX_VEHICLES; i++)
{
if(VehicleFollow[i] != -1)
{
GetVehiclePos(VehicleFollow[i],Pos[0],Pos[1],Pos[2]);
SetVehiclePos(i,Pos[0],Pos[1]-8,Pos[2]);
}
}
Good luck.
Reply
#3

Works, Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)