12.09.2010, 11:19
You could make a custom function
Can't garantuee that it will work 100%, or work at all.
pawn Код:
stock SetVehicleAndTrailerPos(vehicleid, trailerid, Float:posx, Float:posy, Float:posz)
{
new Float:bx, Float:by;
GetVehicleTrailer( vehicleid );
SetVehiclePos( vehicleid, posx, posy, posz );
GetXYBehindVehicle( vehicleid, bx, by, 5.0 );
SetVehiclePos( trailerid, bx, by, posz );
AttachTrailerToVehicle( trailerid, vehicleid );
return true;
}
pawn Код:
stock GetXYBehindOfVehicle(vehicleid, &Float:x, &Float:y, Float:distance)
{
new
Float:a;
GetVehiclePos( vehicleid, x, y, a );
GetVehicleZAngle( vehicleid, a );
x += ( distance * floatsin( -a+180, degrees ));
y += ( distance * floatcos( -a+180, degrees ));
}

