-
Notifications
You must be signed in to change notification settings - Fork 373
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from adib-yg/master
Add more object functions docs
- Loading branch information
Showing
45 changed files
with
1,927 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
--- | ||
title: AttachPlayerObjectToObject | ||
description: You can use this function to attach player-objects to other player-objects. | ||
tags: ["player", "object", "playerobject"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
You can use this function to attach player-objects to other player-objects. The objects will follow the main object. | ||
|
||
| Name | Description | | ||
|-------------------|-------------------------------------------------------------------------| | ||
| playerid | The ID of the player. | | ||
| objectid | The player-object to attach to another player-object. | | ||
| parentid | The object to attach the object to. | | ||
| Float:OffsetX | The distance between the main object and the object in the X direction. | | ||
| Float:OffsetY | The distance between the main object and the object in the Y direction. | | ||
| Float:OffsetZ | The distance between the main object and the object in the Z direction. | | ||
| Float:RotX | The X rotation between the object and the main object. | | ||
| Float:RotY | The Y rotation between the object and the main object. | | ||
| Float:RotZ | The Z rotation between the object and the main object. | | ||
| bool:syncRotation | If set to `false`, objectid's rotation will not change with parentid's. | | ||
|
||
## Returns | ||
|
||
`true` - The function executed successfully. | ||
|
||
`false` - The function failed to execute. This means the first object (objectid) does not exist. There are no internal checks to verify that the second object (parentid) exists. | ||
|
||
## Examples | ||
|
||
```c | ||
new objectid = CreatePlayerObject(...); | ||
new parentid = CreatePlayerObject(...); | ||
|
||
AttachPlayerObjectToObject(playerid, objectid, parentid, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, true); | ||
``` | ||
## Notes | ||
:::tip | ||
Both objects need to be created before attempting to attach them. | ||
::: | ||
## Related Functions | ||
- [AttachObjectToObject](AttachObjectToObject): Attach an object to other object. | ||
- [AttachObjectToPlayer](AttachObjectToPlayer): Attach an object to a player. | ||
- [AttachObjectToVehicle](AttachObjectToVehicle): Attach an object to a vehicle. | ||
- [AttachPlayerObjectToPlayer](AttachPlayerObjectToPlayer): Attach a player object to a player. | ||
- [CreatePlayerObject](CreatePlayerObject): Create an object for only one player. | ||
- [DestroyPlayerObject](DestroyPlayerObject): Destroy a player object. | ||
- [IsValidPlayerObject](IsValidPlayerObject): Checks if a certain player object is vaild. | ||
- [MovePlayerObject](MovePlayerObject): Move a player object. | ||
- [StopPlayerObject](StopPlayerObject): Stop a player object from moving. | ||
- [SetPlayerObjectPos](SetPlayerObjectPos): Set the position of a player object. | ||
- [SetPlayerObjectRot](SetPlayerObjectRot): Set the rotation of a player object. | ||
- [GetPlayerObjectPos](GetPlayerObjectPos): Locate a player object. | ||
- [GetPlayerObjectRot](GetPlayerObjectRot): Check the rotation of a player object. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
--- | ||
title: BeginObjectEditing | ||
description: Allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface). | ||
tags: ["player", "object"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Allows a player to edit an object (position and rotation) using their mouse on a GUI (Graphical User Interface). | ||
|
||
| Name | Description | | ||
| -------- | ------------------------------------------------- | | ||
| playerid | The ID of the player that should edit the object. | | ||
| objectid | The ID of the object to be edited by the player. | | ||
|
||
## Returns | ||
|
||
`true` - The function executed successfully. Success is reported when a non-existent object is specified, but nothing will happen. | ||
|
||
`false` - The function failed to execute. The player is not connected. | ||
|
||
## Examples | ||
|
||
```c | ||
new object; | ||
public OnGameModeInit() | ||
{ | ||
object = CreateObject(1337, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); | ||
return 1; | ||
} | ||
|
||
public OnPlayerCommandText(playerid, cmdtext[]) | ||
{ | ||
if (!strcmp(cmdtext, "/oedit", true)) | ||
{ | ||
BeginObjectEditing(playerid, object); | ||
SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You can now edit the object!"); | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
``` | ||
## Notes | ||
:::tip | ||
You can move the camera while editing by pressing and holding the spacebar (or W in vehicle) and moving your mouse. | ||
::: | ||
## Related Functions | ||
- [CreateObject](CreateObject): Create an object. | ||
- [DestroyObject](DestroyObject): Destroy an object. | ||
- [MoveObject](MoveObject): Move an object. | ||
- [BeginPlayerObjectEditing](BeginPlayerObjectEditing): Edit an object. | ||
- [EditAttachedObject](EditAttachedObject): Edit an attached object. | ||
- [BeginObjectSelecting](BeginObjectSelecting): Select an object. | ||
- [EndObjectEditing](EndObjectEditing): Cancel the edition of an object. |
Oops, something went wrong.