Skip to content

Commit

Permalink
Merge pull request #792 from adib-yg/master
Browse files Browse the repository at this point in the history
Added more 3DTextLabel/Player3DTextLabel documents
  • Loading branch information
AmyrAhmady authored Dec 15, 2023
2 parents 11f7ba1 + 4e0af3c commit 4753b8f
Show file tree
Hide file tree
Showing 35 changed files with 1,164 additions and 10 deletions.
1 change: 1 addition & 0 deletions docs/scripting/functions/Attach3DTextLabelToPlayer.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ public OnPlayerConnect(playerid)
- [Create3DTextLabel](Create3DTextLabel): Create a 3D text label.
- [Delete3DTextLabel](Delete3DTextLabel): Delete a 3D text label.
- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): Gets the 3D text label attached data.
- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Attach a 3D text label to a vehicle.
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Create A 3D text label for one player.
Expand Down
1 change: 1 addition & 0 deletions docs/scripting/functions/Attach3DTextLabelToVehicle.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public OnGameModeExit ( )
- [Create3DTextLabel](Create3DTextLabel): Create a 3D text label.
- [Delete3DTextLabel](Delete3DTextLabel): Delete a 3D text label.
- [Get3DTextLabelAttachedData](Get3DTextLabelAttachedData): Gets the 3D text label attached data.
- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Create A 3D text label for one player.
Expand Down
11 changes: 11 additions & 0 deletions docs/scripting/functions/Create3DTextLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,20 @@ If text[] is empty, the server/clients next to the text might crash! If the virt
## Related Functions

- [Delete3DTextLabel](Delete3DTextLabel): Delete a 3D text label.
- [IsValid3DTextLabel](IsValid3DTextLabel): Checks if a 3D text label is valid.
- [Is3DTextLabelStreamedIn](Is3DTextLabelStreamedIn): Checks if a 3D text label is streamed in for a player.
- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Attach a 3D text label to a vehicle.
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
- [Get3DTextLabelText](Get3DTextLabelText): Gets the 3D text label text.
- [Get3DTextLabelColour](Get3DTextLabelColour): Gets the 3D text label colour.
- [Get3DTextLabelPos](Get3DTextLabelPos): Gets the 3D text label position.
- [Get3DTextLabelDrawDistance](Get3DTextLabelDrawDistance): Gets the 3D text label draw distance.
- [Set3DTextLabelDrawDistance](Set3DTextLabelDrawDistance): Sets the 3D text label draw distance.
- [Get3DTextLabelVirtualWorld](Get3DTextLabelVirtualWorld): Gets the 3D text label virtual world id.
- [Set3DTextLabelVirtualWorld](Set3DTextLabelVirtualWorld): Sets the 3D text label virtual world id.
- [Get3DTextLabelLOS](Get3DTextLabelLOS): Gets the 3D text label line-of-sight.
- [Set3DTextLabelLOS](Set3DTextLabelLOS): Sets the 3D text label line-of-sight.
- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Create A 3D text label for one player.
- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): Delete a player's 3D text label.
- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Change the text of a player's 3D text label.
16 changes: 11 additions & 5 deletions docs/scripting/functions/CreatePlayer3DTextLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,16 @@ If text[] is empty, the server/clients next to the text might crash!

## Related Functions

- [Create3DTextLabel](Create3DTextLabel): Create a 3D text label.
- [Delete3DTextLabel](Delete3DTextLabel): Delete a 3D text label.
- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Attach a 3D text label to a vehicle.
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
- [DeletePlayer3DTextLabel](DeletePlayer3DTextLabel): Delete a player's 3D text label.
- [IsValidPlayer3DTextLabel](IsValidPlayer3DTextLabel): Checks if a player's 3D text label is valid.
- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Change the text of a player's 3D text label.
- [GetPlayer3DTextLabelText](GetPlayer3DTextLabelText): Gets the player's 3D text label text.
- [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour): Gets the player's 3D text label colour.
- [GetPlayer3DTextLabelPos](GetPlayer3DTextLabelPos): Gets the player's 3D text label position.
- [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance): Gets the player's 3D text label draw distance.
- [SetPlayer3DTextLabelDrawDistance](SetPlayer3DTextLabelDrawDistance): Sets the player's 3D text label draw distance.
- [GetPlayer3DTextLabelVirtualWorld](GetPlayer3DTextLabelVirtualWorld): Gets the player's 3D text label virtual world id.
- [SetPlayer3DTextLabelVirtualWorld](SetPlayer3DTextLabelVirtualWorld): Sets the player's 3D text label virtual world id.
- [GetPlayer3DTextLabelLOS](GetPlayer3DTextLabelLOS): Gets the player's 3D text label line-of-sight.
- [SetPlayer3DTextLabelLOS](SetPlayer3DTextLabelLOS): Sets the player's 3D text label line-of-sight.
- [Create3DTextLabel](Create3DTextLabel): Create a global 3D text label.
2 changes: 2 additions & 0 deletions docs/scripting/functions/Delete3DTextLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ Delete3DTextLabel(gMyLabel);
## Related Functions
- [Create3DTextLabel](Create3DTextLabel): Create a 3D text label.
- [IsValid3DTextLabel](IsValid3DTextLabel): Checks if a 3D text label is valid.
- [Is3DTextLabelStreamedIn](Is3DTextLabelStreamedIn): Checks if a 3D text label is streamed in for a player.
- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Attach a 3D text label to a vehicle.
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
Expand Down
1 change: 1 addition & 0 deletions docs/scripting/functions/DeletePlayer3DTextLabel.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,4 @@ DeletePlayer3DTextLabel(playerid, labelid);
- [Update3DTextLabelText](Update3DTextLabelText): Change the text of a 3D text label.
- [CreatePlayer3DTextLabel](CreatePlayer3DTextLabel): Create A 3D text label for one player.
- [UpdatePlayer3DTextLabelText](UpdatePlayer3DTextLabelText): Change the text of a player's 3D text label.
- [IsValidPlayer3DTextLabel](IsValidPlayer3DTextLabel): Checks if a player's 3D text label is valid.
55 changes: 55 additions & 0 deletions docs/scripting/functions/Get3DTextLabelAttachedData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
title: Get3DTextLabelAttachedData
description: Gets the 3D text label attached data.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label attached data.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the attached data of. |
| &parentPlayerid | A variable into which to store the parentPlayerid, passed by reference. |
| &parentVehicleid | A variable into which to store the parentVehicleid, passed by reference. |

## Examples

An example for parentPlayerid:

```c
new Text3D:gMyLabel;
new parentPlayerid;
new parentVehicleid;

gMyLabel = Create3DTextLabel("Hello, I am new here!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, false);
Attach3DTextLabelToPlayer(gMyLabel, playerid, 0.0, 0.0, 0.7);

Get3DTextLabelAttachedData(gMyLabel, parentPlayerid, parentVehicleid);
```
An example for parentVehicleid:
```c
new Text3D:gVehicle3dText[MAX_VEHICLES];
new gVehicleId;
new parentPlayerid;
new parentVehicleid;
gVehicleId = CreateVehicle(510, 0.0, 0.0, 15.0, 5, 0, 120);
gVehicle3dText[gVehicleId] = Create3DTextLabel("Example Text", 0xFF0000AA, 0.0, 0.0, 0.0, 50.0, 0, false);
Attach3DTextLabelToVehicle(gVehicle3dText[gVehicleId], gVehicleId, 0.0, 0.0, 2.0);
Get3DTextLabelAttachedData(gVehicle3dText[gVehicleId], parentPlayerid, parentVehicleid);
// The `parentVehicleid` will be the value of 'gVehicleId'
```

## Related Functions

- [Attach3DTextLabelToPlayer](Attach3DTextLabelToPlayer): Attach a 3D text label to a player.
- [Attach3DTextLabelToVehicle](Attach3DTextLabelToVehicle): Attaches a 3D Text Label to a specific vehicle.
- [GetPlayer3DTextLabelAttachedData](GetPlayer3DTextLabelAttachedData): Gets the player 3D text label attached data.
38 changes: 38 additions & 0 deletions docs/scripting/functions/Get3DTextLabelColor.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
title: Get3DTextLabelColor
description: Gets the 3D text label color.
tags: ["3dtextlabel"]
---

:::warning

This function is deprecated. Please see [Get3DTextLabelColour](Get3DTextLabelColour).

:::

## Description

Gets the 3D text label color.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the color of. |

## Returns

Returns the 3D text label color.

## Examples

```c
new Text3D:gMyLabel;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false);

new color = Get3DTextLabelColor(gMyLabel);
// The `color` will be 0x008080FF
```

## Related Functions

- [GetPlayer3DTextLabelColor](GetPlayer3DTextLabelColor): Gets the player 3D text label color.
34 changes: 34 additions & 0 deletions docs/scripting/functions/Get3DTextLabelColour.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Get3DTextLabelColour
description: Gets the 3D text label colour.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label colour.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the colour of. |

## Returns

Returns the 3D text label colour.

## Examples

```c
new Text3D:gMyLabel;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false);

new colour = Get3DTextLabelColour(gMyLabel);
// The `colour` will be 0x008080FF
```

## Related Functions

- [GetPlayer3DTextLabelColour](GetPlayer3DTextLabelColour): Gets the player 3D text label colour.
36 changes: 36 additions & 0 deletions docs/scripting/functions/Get3DTextLabelDrawDistance.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Get3DTextLabelDrawDistance
description: Gets the 3D text label draw distance.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label draw distance.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the draw distance of. |

## Returns

Returns the draw distance of the 3D text label as float.

## Examples

```c
new Text3D:gMyLabel;
new Float:drawdistance;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, false);

drawdistance = Get3DTextLabelDrawDistance(gMyLabel);
// The `drawdistance` will be 10.0
```

## Related Functions

- [Set3DTextLabelDrawDistance](Set3DTextLabelDrawDistance): Sets the 3D text label draw distance.
- [GetPlayer3DTextLabelDrawDistance](GetPlayer3DTextLabelDrawDistance): Gets the player 3D text label draw distance.
36 changes: 36 additions & 0 deletions docs/scripting/functions/Get3DTextLabelLOS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Get3DTextLabelLOS
description: Gets the 3D text label line-of-sight.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label line-of-sight.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the line-of-sight of. |

## Returns

Returns the line-of-sight of the 3D text label as boolean (false/true).

## Examples

```c
new Text3D:gMyLabel;
new bool:testLOS;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 0, true);

testLOS = Get3DTextLabelLOS(gMyLabel);
// The `testLOS` will be true
```

## Related Functions

- [Set3DTextLabelLOS](Set3DTextLabelLOS): Sets the 3D text label line-of-sight.
- [GetPlayer3DTextLabelLOS](GetPlayer3DTextLabelLOS): Gets the player 3D text label line-of-sight.
34 changes: 34 additions & 0 deletions docs/scripting/functions/Get3DTextLabelPos.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
title: Get3DTextLabelPos
description: Gets the 3D text label position.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label position.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the position of. |
| &Float:x | An float variable into which to store the X coordinate, passed by reference. |
| &Float:y | An float variable into which to store the Y coordinate, passed by reference. |
| &Float:z | An float variable into which to store the Z coordinate, passed by reference. |

## Examples

```c
new Text3D:gMyLabel;
new Float:x, Float:y, Float:z;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false);

Get3DTextLabelPos(gMyLabel, x, y, z);
// The x, y, z will be 30.0, 40.0, 50.0
```
## Related Functions
- [GetPlayer3DTextLabelPos](GetPlayer3DTextLabelPos): Gets the player 3D text label position.
35 changes: 35 additions & 0 deletions docs/scripting/functions/Get3DTextLabelText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: Get3DTextLabelText
description: Gets the 3D text label text.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label text.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the text of. |
| text[] | An array into which to store the text, passed by reference. |
| len | The length of the text that should be stored. |

## Examples

```c
new Text3D:gMyLabel;
new text[16];

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 40.0, 0, false);

Get3DTextLabelText(gMyLabel, text, sizeof(text));
// The `text` will be 'Hello World!'
```
## Related Functions
- [Create3DTextLabel](Create3DTextLabel): Create a 3D text label.
- [Update3DTextLabelText](Update3DTextLabelText): Updates a 3D Text Label text and colour.
- [GetPlayer3DTextLabelText](GetPlayer3DTextLabelText): Gets the player 3D text label text.
36 changes: 36 additions & 0 deletions docs/scripting/functions/Get3DTextLabelVirtualWorld.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
---
title: Get3DTextLabelVirtualWorld
description: Gets the 3D text label virtual world id.
tags: ["3dtextlabel"]
---

<VersionWarn version='omp v1.1.0.2612' />

## Description

Gets the 3D text label virtual world id.

| Name | Description |
| --------- | ------------------------------------------------------------------------- |
| Text3D:textid | The ID of the 3D text label to get the virtual world id of. |

## Returns

Returns the virtual world id of the 3D text label.

## Examples

```c
new Text3D:gMyLabel;
new worldid;

gMyLabel = Create3DTextLabel("Hello World!", 0x008080FF, 30.0, 40.0, 50.0, 10.0, 20, false);

worldid = Get3DTextLabelVirtualWorld(gMyLabel);
// The `worldid` will be 20
```

## Related Functions

- [Set3DTextLabelVirtualWorld](Set3DTextLabelVirtualWorld): Sets the 3D text label virtual world id.
- [GetPlayer3DTextLabelVirtualWorld](GetPlayer3DTextLabelVirtualWorld): Gets the player 3D text label virtual world id.
Loading

0 comments on commit 4753b8f

Please sign in to comment.