PDA

View Full Version : Keeping vehicle


NRJ53
20/12/2011, 12:58 AM
Hello

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

Thanks.

coole210
20/12/2011, 01:17 AM
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.

NRJ53
20/12/2011, 01:41 AM
Works, Thank you.