23.03.2013, 16:11
Basically, he's saying that you can create the object, edit the object and put this code underneath OnPlayerEditObject. In the code below, it basically takes the XYZ position of the object and subtracts the vehicle's position FROM the object's coordinates.
I didn't even know that was possible until I saw this... the only issue with the code below is that it doesn't set the proper rotation when attaching the object to the vehicle. I'm not sure how I'd accomplish that.
I didn't even know that was possible until I saw this... the only issue with the code below is that it doesn't set the proper rotation when attaching the object to the vehicle. I'm not sure how I'd accomplish that.
pawn Код:
new
Float:fPos[3]
;
GetVehiclePos(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
printf("\n\nOBJECT OFFSETS: %f, %f, %f, %f, %f, %f\n\n", x-fPos[0], y-fPos[1], z-fPos[2], rx, ry, rz);
AttachDynamicObjectToVehicle(objectid, GetPlayerVehicleID(playerid), x-fPos[0], y-fPos[1], z-fPos[2], rx, ry, rz);