12.09.2010, 09:53
Topic title says all
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;
}
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 ));
}
You could make a custom function
pawn Код:
pawn Код:
|