SA-MP Forums Archive
How to save Object Rotation in variable? - 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: How to save Object Rotation in variable? (/showthread.php?tid=657097)



How to save Object Rotation in variable? - R3SpaWn0 - 31.07.2018

Hi, i m trying to make a door and i can make the door open, but i want to get the door closed at the position that the door was.. but i can 't get it work.. anyone know how to do it?

if (IsPlayerNearDynamicObject(playerid, Doors[doorls][0]))
{

SetDynamicObjectRot(Doors[doorls][0], 0, 0, 90);
Doors[doorOpen][0] = true;
SendErrorMessage(playerid, "The door has been opened !");
}


but i want to

GetDynamicObjectRot(Doors[doorls][0]; and save it into variable to use
SetDynamicObjectRot again.. how can i do to close the door?

How can i know the original rotate position of door and show it?

thanks !


Re: How to save Object Rotation in variable? - Rufio - 01.08.2018

Save the original position/rotation to a variable, set it back to the original pos variable once the user closes the door.