Scripting/Server/Functions/EditObject
Opens the built-in 3D editor for one object on that player's screen (SA-MP EditObject / BeginObjectEditing; also player.EditObject(object)). The camera orbits the object and a gizmo with move arrows, rotate rings and scale handles is drawn on it. PC: drag a handle with the left mouse button, right button orbits, middle pans, wheel zooms, keys 1/2/3 pick the mode, Enter saves, Esc cancels, Shift = fine. Android: touch the on-screen buttons, drag a handle, drag empty space to orbit. The result arrives in onPlayerEditObject; nothing is applied automatically - set object.Pos, Rotation and Scale yourself.
Syntax
EditObject(player, object [, allowScale = true])Arguments
- Player player
- Object object
- any allowScale = true (optional)
Returns
true when the editor was opened.
Example
function onPlayerCommand( player, cmd, params )
{
if ( cmd == "editobject" )
{
local result = EditObject( player, obj );
MessagePlayer( "EditObject returned: " + result, player );
}
}This sample was generated from the signature – adapt the values to your gamemode.
Related pages
Section: Audio streams, object editor and object picker (v0.3)