OnPlayerSelectObject

warning

This function was added in SA-MP 0.3e and will not work in earlier versions!

Description

This callback is called when a player selects an object after SelectObject has been used.

NameDescription
playeridThe ID of the player that selected an object
typeThe type of selection
objectidThe ID of the selected object
modelidThe model of the selected object
Float:fXThe X position of the selected object
Float:fYThe Y position of the selected object
Float:fZThe Z position of the selected object

Returns

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:fX, Float:fY, Float:fZ)
{
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 1;
}

Related Functions