EditPlayerObject
Description:
Function EditPlayerObject allows players to edit a player-object (position and rotation) with a GUI and their mouse.
Function EditPlayerObject 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 object to be edited by the player. |
Return Values:
- 1: The function was executed successfully.
- 0: The function failed to execute. Player or object not valid.
Examples:
new object[MAX_PLAYERS]; public OnPlayerSpawn(playerid) { object[playerid] = CreatePlayerObject(playerid, 1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); } public OnPlayerCommandText(playerid, cmdtext[]) { if(!strcmp(cmdtext, "/edit", true)) { EditPlayerObject(playerid, object[playerid]); SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You now edit your 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.
- CreatePlayerObject - Create an player-object.
- DestroyPlayerObject - Destroy an object.
- GetPlayerObjectPos - Get an object's position.
- GetPlayerObjectRot - Get an object's rotation.
- IsValidPlayerObject - Check if an object exists.
- MovePlayerObject - Move an object.
- SetPlayerObjectPos - Set an object's position.
- SetPlayerObjectRot - Set an object's rotation.
- StopPlayerObject - Stop an object (moving).