Quote:
Originally Posted by LarzI
You could make a custom function
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 )); }
Can't garantuee that it will work 100%, or work at all.
|
Stocks are supposed to return a value, or am I wrong?