Skip to content

Commit

Permalink
update callbacks/OnPlayerSelectObject.md
Browse files Browse the repository at this point in the history
  • Loading branch information
adib-yg committed Jan 12, 2024
1 parent 6142c0f commit d14bc36
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions docs/scripting/callbacks/OnPlayerSelectObject.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
---
title: OnPlayerSelectObject
description: This callback is called when a player selects an object after SelectObject has been used.
description: This callback is called when a player selects an object after BeginObjectSelecting has been used.
tags: ["player"]
---

<VersionWarn name='callback' version='SA-MP 0.3e' />

## Description

This callback is called when a player selects an object after [SelectObject](../functions/SelectObject) has been used.
This callback is called when a player selects an object after [BeginObjectSelecting](../functions/BeginObjectSelecting) has been used.

| Name | Description |
| -------- | ---------------------------------------------------------- |
| playerid | The ID of the player that selected an object |
| type | The [type](../resources/selectobjecttypes) of selection |
| objectid | The ID of the selected object |
| modelid | The model of the selected object |
| Float:fX | The X position of the selected object |
| Float:fY | The Y position of the selected object |
| Float:fZ | The Z position of the selected object |
| Name | Description |
|--------------------|---------------------------------------------------------|
| playerid | The ID of the player that selected an object |
| SELECT_OBJECT:type | The [type](../resources/selectobjecttypes) of selection |
| objectid | The ID of the selected object |
| modelid | The model of the selected object |
| Float:fX | The X position of the selected object |
| Float:fY | The Y position of the selected object |
| Float:fZ | The Z position of the selected object |

## Returns

Expand All @@ -36,11 +36,11 @@ public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:f
printf("Player %d selected object %d", playerid, objectid);
if (type == SELECT_OBJECT_GLOBAL_OBJECT)
{
EditObject(playerid, objectid);
BeginObjectEditing(playerid, objectid);
}
else
{
EditPlayerObject(playerid, objectid);
BeginPlayerObjectEditing(playerid, objectid);
}
SendClientMessage(playerid, 0xFFFFFFFF, "You now are able to edit your object!");
return 1;
Expand All @@ -51,4 +51,4 @@ public OnPlayerSelectObject(playerid, type, objectid, modelid, Float:fX, Float:f
The following functions might be useful, as they're related to this callback in one way or another.
- [SelectObject](../functions/SelectObject): Select an object.
- [BeginObjectSelecting](../functions/BeginObjectSelecting): Select an object.

0 comments on commit d14bc36

Please sign in to comment.