28.12.2016, 10:42
Quote:
First, you let the player to edit a specific object by using EditObject or you can also let the player to select the object first to edit with SelectObject and then call EditObject when OnPlayerSelectObject.
Now that whenever the player interact with the buttons from EditObject, the OnPlayerEditObject will be called and there are some data that you can get: playerid = The ID of the player that is editing the object, playerobject = The type of object that is being edited, 0 if it's a global object (created with CreateObject) or 1 if it's a player object (created with CreatePlayerObject), objectid = The ID of the object that is being edited by the player, response = Which button that player is clicking/pressing on while they are editing the object? and then the offset & rotation values of the new position after the player moved it. For example, there is a player ID 0 editing a global object ID 1 (which was created with CreateObject with position X=0.0, Y=0.0, Z=0.0). If the player pressed "ESC" button (response = 0), then they will exit Editing Object If the player clicked/dragged the arrow for X offset (response = 2) to the right about 1.0 then the new position of the object will be (X=1.0, Y=0.0 Z=0.0) If the player clicked the "Save" icon, then the player will exit editing the object and you can place your code at this case to save the object. |
