SA-MP Forums Archive
OnPlayerEditAttachedObject problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerEditAttachedObject problem (/showthread.php?tid=620664)



OnPlayerEditAttachedObject problem - 963852741 - 01.11.2016

Hi,
I have this code:
pawn Код:
else if(EditingWeapon[playerid])
        {
            WeaponDat[playerid][WeaponRotX][b] = fRotX;
            WeaponDat[playerid][WeaponRotY][b] = fRotY;
            WeaponDat[playerid][WeaponRotZ][b] = fRotZ;
            WeaponDat[playerid][WeaponX][b] = fOffsetX;
            WeaponDat[playerid][WeaponY][b] = fOffsetY;
            WeaponDat[playerid][WeaponZ][b] = fOffsetZ;
            printf("%d, %d, %d, %f, %f, %f, %f, %f, %f", index, modelid, boneid, WeaponDat[playerid][WeaponX][b], WeaponDat[playerid][WeaponY][b], WeaponDat[playerid][WeaponZ][b], WeaponDat[playerid][WeaponRotX][b], WeaponDat[playerid][WeaponRotY][b], WeaponDat[playerid][WeaponRotZ][b]);
            //RemovePlayerAttachedObject(playerid, d);
            //SetPlayerAttachedObject(playerid, d, modelid, boneid,WeaponDat[playerid][WeaponX][b], WeaponDat[playerid][WeaponY][b], WeaponDat[playerid][WeaponZ][b], WeaponDat[playerid][WeaponRotX][b], WeaponDat[playerid][WeaponRotY][b], WeaponDat[playerid][WeaponRotZ][b]);
            EditingWeapon[playerid] = false;
        }
This is meant whenever a player confirms an edit of the attached object on him, but the values are reversed. The Float:fOffsetX, Float:fOffsetY, Float:fOffsetZ become Float:fRotX, Float:fRotY, Float:fRotZ and vice versa. I noticed it when I debugged it on the printf function. Can anyone tell me why does it happen?