30.12.2010, 19:59
There are two different angle systems used in samp (quite confusing, i guess this is a pawn library problem)
Without checking it (correct me if it is wrong, it might be the other way round):
The one, used in GetPlayerFacingAngle etc. is -0 to -180 for the "left side" and +0 to +180 for the "right side". 0 would be north, -90 west, 90 east, +/-180 south.
The other scale is used in floatsin and other float stuff. It counts anticlockwise, from 0 to 360. 0/360 would be north, 90 west, 180 south, 270 east.
To make both compatible with each other, do this:
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
angle = 360 - angle;
In your case this would be:
SetPlayerAttachedObject(playerid, 1, 1318, 1, 0.755045, 0.161908, 0.036331, 360 - angle);
Without checking it (correct me if it is wrong, it might be the other way round):
The one, used in GetPlayerFacingAngle etc. is -0 to -180 for the "left side" and +0 to +180 for the "right side". 0 would be north, -90 west, 90 east, +/-180 south.
The other scale is used in floatsin and other float stuff. It counts anticlockwise, from 0 to 360. 0/360 would be north, 90 west, 180 south, 270 east.
To make both compatible with each other, do this:
new Float:angle;
GetPlayerFacingAngle(playerid, angle);
angle = 360 - angle;
In your case this would be:
SetPlayerAttachedObject(playerid, 1, 1318, 1, 0.755045, 0.161908, 0.036331, 360 - angle);