EditObject

EditObject

Description:
Function EditObject allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface).
Function EditObject was added in 0.3e and will not work in earlier versions!
You can move the camera while editing by pressing and holding the spacebar (or W in vehicle) and moving your mouse.



Parameters:
(playerid, objectid)
int playerid The ID of the player that should edit the object.
int objectid The ID of the object to be edited by the player.


Return Values:
  • 1: The function was executed successfully. Success is reported when a non-existent object is specified, but nothing will happen.
  • 0: The function failed to execute. The player is not connected.


Examples:
new object;
public OnGameModeInit()
{
    object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
    return 1;
}
 
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/oedit", true))
    {
        EditObject(playerid, object);
        SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You can now edit the object!");
        return 1;
    }
    return 0;
}


Related Functions
The following functions may be useful, as they are related to this function in one way or another.