23.03.2013, 17:25
If you're facing East, West, SE, or SW, this code seems to work just fine. It's only when you're facing North/South that it won't work properly. I'm working on a fix, though!
pawn Код:
if(response == EDIT_RESPONSE_FINAL)
{
new
Float:fPos[6],
Float:temp
;
GetVehiclePos(GetPlayerVehicleID(playerid), fPos[0], fPos[1], fPos[2]);
GetVehicleRotationQuat(GetPlayerVehicleID(playerid), temp, fPos[3], fPos[4], fPos[5]);
printf("\n\nOBJECT OFFSETS: %f, %f, %f, %f, %f, %f\n\n", x-fPos[0], y-fPos[1], z-fPos[2], fPos[3], fPos[4], fPos[5]);
AttachDynamicObjectToVehicle(objectid, GetPlayerVehicleID(playerid), x-fPos[0], y-fPos[1], z-fPos[2], fPos[3], fPos[4], fPos[5]);
SendClientMessage(playerid, COLOR_GREEN, "Results printed to server log.");
}