OnPlayerSelectObject

OnPlayerSelectObject

Description:
Callback OnPlayerSelectObject is called when a player selects an object after SelectObject has been used.
Callback OnPlayerSelectObject was added in 0.3e and will not work in earlier versions!


Parameters:
(playerid, type, objectid, modelid, Float:X, Float:Y, Float:Z)
int playerid The ID of the player that selected an object.
int type The type of selection.
int objectid The ID of the selected object.
int modelid The model of the selected object.
float X The X position of the selected object.
float Y The Y position of the selected object.
float Z The Z position of the selected object.


Return Values:
  • 1 - Will prevent other scripts from receiving this callback.
  • 0 - Indicates that this callback will be passed to the next script.
  • It is always called first in filterscripts.


Examples:
public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:X, Float:Y, Float:Z)
{
    printf("Player %d selected object %d", playerid, objectid);
    if(type == SELECT_OBJECT_GLOBAL_OBJECT)
    {
        EditObject(playerid, objectid);
    }
    else
    {
        EditPlayerObject(playerid, objectid);
    }
    SendClientMessage(playerid, 0xFFFFFFFF, "You now are able to edit your object!");
    return 0;
}


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