Skip to content

Commit

Permalink
Added more documents (#796)
Browse files Browse the repository at this point in the history
* add IsPlayerTextDrawVisible.md

* add IsTextDrawVisibleForPlayer.md

* add IsValidPlayerTextDraw.md

* add IsValidTextDraw.md

* add PlayerTextDrawBackgroundColour.md

* add PlayerTextDrawBoxColour.md

* add PlayerTextDrawColour.md

* add PlayerTextDrawGetAlignment.md

* add PlayerTextDrawGetBackgroundCol.md

* add PlayerTextDrawGetBackgroundColour.md

* add PlayerTextDrawGetBoxColor.md

* add PlayerTextDrawGetBoxColour.md

* add PlayerTextDrawGetColor.md

* add PlayerTextDrawGetColour.md

* add PlayerTextDrawGetFont.md

* add PlayerTextDrawGetLetterSize.md

* add PlayerTextDrawGetOutline.md

* add PlayerTextDrawGetPos.md

* add PlayerTextDrawGetPreviewModel.md

* add PlayerTextDrawGetPreviewRot.md

* add PlayerTextDrawGetPreviewVehCol.md

* add PlayerTextDrawGetPreviewVehicleColours.md

* add PlayerTextDrawGetShadow.md

* add PlayerTextDrawGetString.md

* add PlayerTextDrawGetTextSize.md

* add PlayerTextDrawIsBox.md

* add PlayerTextDrawIsProportional.md

* add PlayerTextDrawIsSelectable.md

* add PlayerTextDrawSetPos.md

* add PlayerTextDrawSetPreviewVehicleColours.md

* add TextDrawBackgroundColour.md

* add TextDrawBoxColour.md

* add TextDrawColour.md

* add TextDrawGetAlignment.md

* add TextDrawGetBackgroundColor.md

* add TextDrawGetBackgroundColour.md

* add TextDrawGetBoxColor.md

* add TextDrawGetBoxColour.md

* add TextDrawGetColor.md

* add TextDrawGetColour.md

* add TextDrawGetFont.md

* add TextDrawGetLetterSize.md

* add TextDrawGetOutline.md

* add TextDrawGetPos.md

* add TextDrawGetPreviewModel.md

* add TextDrawGetPreviewRot.md

* add TextDrawGetPreviewVehCol.md

* add TextDrawGetPreviewVehicleColours.md

* add TextDrawGetShadow.md

* add TextDrawGetString.md

* add TextDrawGetTextSize.md

* add TextDrawIsBox.md

* add TextDrawIsProportional.md

* add TextDrawIsSelectable.md

* add TextDrawSetPos.md

* add TextDrawSetPreviewVehicleColours.md

* add TextDrawSetStringForPlayer.md

* update CreatePlayerTextDraw.md

* update PlayerTextDrawAlignment.md

* update PlayerTextDrawFont.md

* update PlayerTextDrawLetterSize.md

* update PlayerTextDrawSetOutline.md

* update PlayerTextDrawSetPreviewModel.md

* update PlayerTextDrawSetProportional.md

* update PlayerTextDrawSetSelectable.md

* update PlayerTextDrawSetShadow.md

* update PlayerTextDrawSetString.md

* update PlayerTextDrawTextSize.md

* update PlayerTextDrawUseBox.md

* update TextDrawAlignment.md

* update TextDrawBackgroundColor.md

* update TextDrawCreate.md

* update TextDrawFont.md

* update TextDrawHideForPlayer.md

* update TextDrawLetterSize.md

* update TextDrawSetOutline.md

* update TextDrawSetPreviewModel.md

* update TextDrawSetPreviewRot.md

* update TextDrawSetProportional.md

* update TextDrawSetSelectable.md

* update TextDrawSetShadow.md

* update TextDrawSetString.md

* update TextDrawShowForPlayer.md

* update TextDrawTextSize.md

* update TextDrawUseBox.md

* fix some tag mistakes in parameter descriptions

* remove duplicate notes from ## Returns

* fix a tag mistake in parameter description

* fix other mistakes

* fix a tag mistake in parameter description

* add IsPlayerCheckpointActive.md

* add IsPlayerRaceCheckpointActive.md

* add GetPlayerCheckpoint.md

* add GetPlayerRaceCheckpoint.md

* update SetPlayerCheckpoint.md

* update SetPlayerRaceCheckpoint.md

* update DisablePlayerCheckpoint.md

* update DisablePlayerRaceCheckpoint.md

* update IsPlayerInCheckpoint.md

* update IsPlayerInRaceCheckpoint.md

* add GetPlayerDialogData.md

* add GetPlayerDialogID.md

* add GetPlayerDialog.md

* update ShowPlayerDialog.md

* add SetActorSkin.md

* add GetActorSkin.md

* add GetActorSpawnInfo.md

* add GetActorAnimation.md

* update CreateActor.md

* update ApplyActorAnimation.md

* add SetPlayerAdmin.md

* update IsPlayerAdmin.md

* update callbacks/OnRconLoginAttempt.md

* update callbacks/OnRconCommand.md

* add IsValidTimer.md

* add IsRepeatingTimer.md

* add GetTimerInterval.md

* add GetTimerRemaining.md

* update SetTimer.md

* update SetTimerEx.md

* update KillTimer.md

* update CountRunningTimers.md
  • Loading branch information
adib-yg authored Jan 2, 2024
1 parent 8afc016 commit eceedde
Show file tree
Hide file tree
Showing 118 changed files with 4,291 additions and 71 deletions.
3 changes: 2 additions & 1 deletion docs/scripting/callbacks/OnRconCommand.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: OnRconCommand
description: This callback is called when a command is sent through the server console, remote RCON, or via the in-game "/rcon command".
tags: []
tags: ["rcon", "administration"]
---

## Description
Expand Down Expand Up @@ -62,3 +62,4 @@ The following callbacks might be useful, as they're related to this callback in
The following functions might be useful, as they're related to this callback in one way or another.
- [IsPlayerAdmin](../functions/IsPlayerAdmin): Checks if a player is logged into RCON.
- [SetPlayerAdmin](../functions/SetPlayerAdmin): Sets the player as an RCON admin.
3 changes: 2 additions & 1 deletion docs/scripting/callbacks/OnRconLoginAttempt.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: OnRconLoginAttempt
description: This callback is called when someone attempts to log in to RCON in-game; successful or not.
tags: []
tags: ["rcon", "administration"]
---

<VersionWarn name='callback' version='SA-MP 0.3a' />
Expand Down Expand Up @@ -62,4 +62,5 @@ The following callbacks might be useful, as they're related to this callback in
The following functions might be useful, as they're related to this callback in one way or another.
- [IsPlayerAdmin](../functions/IsPlayerAdmin): Checks if a player is logged into RCON.
- [SetPlayerAdmin](../functions/SetPlayerAdmin): Sets the player as an RCON admin.
- [SendRconCommand](../functions/SendRconCommand): Sends an RCON command via the script.
3 changes: 2 additions & 1 deletion docs/scripting/functions/ApplyActorAnimation.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: ApplyActorAnimation
description: Apply an animation to an actor.
tags: []
tags: ["actor"]
---

<VersionWarn version='SA-MP 0.3.7' />
Expand Down Expand Up @@ -52,3 +52,4 @@ You must preload the animation library for the player the actor will be applying
## Related Functions

- [ClearActorAnimations](ClearActorAnimations): Clear any animations that are applied to an actor.
- [GetActorAnimation](GetActorAnimation): Get the animation the actor is currently performing.
2 changes: 1 addition & 1 deletion docs/scripting/functions/CountRunningTimers.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: CountRunningTimers
description: Get the running timers.
tags: []
tags: ["timer"]
---

<VersionWarn version='omp v1.1.0.2612' />
Expand Down
9 changes: 8 additions & 1 deletion docs/scripting/functions/CreateActor.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: CreateActor
description: Create a static 'actor' in the world.
tags: []
tags: ["actor"]
---

<VersionWarn version='SA-MP 0.3.7' />
Expand Down Expand Up @@ -61,21 +61,28 @@ Actors are completely separate from NPCs. They do NOT use player IDs/slots on th
- [DestroyActor](DestroyActor): Destroy an actor.
- [SetActorPos](SetActorPos): Set the position of an actor.
- [GetActorPos](GetActorPos): Get the position of an actor.
- [GetActorSpawnInfo](GetActorSpawnInfo): Get the initial spawn point of the actor.
- [SetActorFacingAngle](SetActorFacingAngle): Set the facing angle of an actor.
- [GetActorFacingAngle](GetActorFacingAngle): Get the facing angle of an actor.
- [SetActorVirtualWorld](SetActorVirtualWorld): Set the virtual world of an actor.
- [GetActorVirtualWorld](GetActorVirtualWorld): Get the virtual world of an actor.
- [ApplyActorAnimation](ApplyActorAnimation): Apply an animation to an actor.
- [ClearActorAnimations](ClearActorAnimations): Clear any animations that are applied to an actor.
- [GetActorAnimation](GetActorAnimation): Get the animation the actor is currently performing.
- [GetPlayerCameraTargetActor](GetPlayerCameraTargetActor): Get the ID of the actor (if any) a player is looking at.
- [IsActorStreamedIn](IsActorStreamedIn): Checks if an actor is streamed in for a player.
- [SetActorSkin](SetActorSkin): Set the skin of the actor.
- [GetActorSkin](GetActorSkin): Get the skin of the actor.
- [SetActorHealth](SetActorHealth): Set the health of an actor.
- [GetActorHealth](GetActorHealth): Gets the health of an actor.
- [SetActorInvulnerable](SetActorInvulnerable): Set actor invulnerable.
- [IsActorInvulnerable](IsActorInvulnerable): Check if actor is invulnerable.
- [IsValidActor](IsValidActor): Check if actor id is valid.
- [GetActorPoolSize](GetActorPoolSize): Gets the highest actorid created on the server.
- [GetPlayerTargetActor](GetPlayerTargetActor): Gets id of an actor which is aimed by certain player.

## Related Callbacks

- [OnActorStreamIn](../callbacks/OnActorStreamIn): Called when an actor is streamed in by a player.
- [OnActorStreamOut](../callbacks/OnActorStreamOut): Called when an actor is streamed out by a player.
- [OnPlayerGiveDamageActor](../callbacks/OnPlayerGiveDamageActor): This callback is called when a player gives damage to an actor.
2 changes: 2 additions & 0 deletions docs/scripting/functions/CreatePlayerTextDraw.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,5 @@ Keyboard key mapping codes (such as ~k~~VEHICLE_ENTER_EXIT~ Doesn't work beyond
- [PlayerTextDrawSetString](PlayerTextDrawSetString): Set the text of a player-textdraw.
- [PlayerTextDrawShow](PlayerTextDrawShow): Show a player-textdraw.
- [PlayerTextDrawHide](PlayerTextDrawHide): Hide a player-textdraw.
- [IsPlayerTextDrawVisible](IsPlayerTextDrawVisible): Checks if a player-textdraw is shown for the player.
- [IsValidPlayerTextDraw](IsValidPlayerTextDraw): Checks if a player-textdraw is valid.
1 change: 1 addition & 0 deletions docs/scripting/functions/DisablePlayerCheckpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public OnPlayerEnterCheckpoint(playerid)
- [SetPlayerCheckpoint](SetPlayerCheckpoint): Create a checkpoint for a player.
- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): Check if a player is in a checkpoint.
- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): Check if the player currently has a checkpoint visible.
- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Create a race checkpoint for a player.
- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): Disable the player's current race checkpoint.
- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint.
Expand Down
1 change: 1 addition & 0 deletions docs/scripting/functions/DisablePlayerRaceCheckpoint.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public OnPlayerLeaveRaceCheckpoint(playerid)
- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): Check if a player is in a checkpoint.
- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Create a race checkpoint for a player.
- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint.
- [IsPlayerRaceCheckpointActive](IsPlayerRaceCheckpointActive): Check if the player currently has a race checkpoint visible.
- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Called when a player enters a checkpoint.
- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Called when a player leaves a checkpoint.
- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Called when a player enters a race checkpoint.
Expand Down
59 changes: 59 additions & 0 deletions docs/scripting/functions/GetActorAnimation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
title: GetActorAnimation
description: Get the animation the actor is currently performing.
tags: ["actor"]
---

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

## Description

Get the animation the actor is currently performing.

| Name | Description |
|--------------------|----------------------------------------------------------------------------|
| actorid | The ID of the actor to get the animation of. |
| animationLibrary[] | An array into which to store the animationLibrary in, passed by reference. |
| librarySize | The size of the animationLibrary array. |
| animationName[] | An array into which to store the animationName in, passed by reference. |
| nameSize | The size of the animationName array. |
| &Float:delta | A float variable into which to store the delta in, passed by reference. |
| &bool:loop | A boolean variable into which to store the loop in, passed by reference. |
| &bool:lockX | A float variable into which to store the lockX in, passed by reference. |
| &bool:lockY | A float variable into which to store the lockY in, passed by reference. |
| &bool:freeze | A boolean variable into which to store the freeze in, passed by reference. |
| &time | A variable into which to store the time in, passed by reference. |

## Return Values

Returns **true** if the actor is valid, otherwise returns **false**.

## Examples

```c
new gMyActor;

public OnGameModeInit()
{
gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000);
ApplyActorAnimation(gMyActor, "PED", "IDLE_CHAT", 4.1, true, true, true, true, 0);

new animationLibrary[32],
animationName[32],
Float:delta,
bool:loop,
bool:lockX,
bool:lockY,
bool:freeze,
time;

GetActorAnimation(gMyActor, animationLibrary, sizeof animationLibrary, animationName, sizeof animationName, delta, loop, lockX, lockY, freeze, time);
return 1;
}
```

## Related Functions

- [CreateActor](CreateActor): Create an actor (static NPC).
- [ApplyActorAnimation](ApplyActorAnimation): Apply an animation to an actor.
- [ClearActorAnimations](ClearActorAnimations): Clear any animations that are applied to an actor.
39 changes: 39 additions & 0 deletions docs/scripting/functions/GetActorSkin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: GetActorSkin
description: Get the skin of the actor.
tags: ["actor"]
---

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

## Description

Get the skin of the actor.

| Name | Description |
|---------|-----------------------------|
| actorid | The ID of the actor to get. |

## Return Values

Returns the actor's current skin.

## Examples

```c
new gMyActor;

public OnGameModeInit()
{
gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000);

new actorSkinID = GetActorSkin(gMyActor);
// The value of `actorSkinID` is now 179
return 1;
}
```

## Related Functions

- [CreateActor](CreateActor): Create an actor (static NPC).
- [SetActorSkin](SetActorSkin): Set the skin of the actor.
52 changes: 52 additions & 0 deletions docs/scripting/functions/GetActorSpawnInfo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
title: GetActorSpawnInfo
description: Get the initial spawn point of the actor.
tags: ["actor"]
---

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

## Description

Get the initial spawn point of the actor.

| Name | Description |
|-------------------|------------------------------------------------------------------------------|
| actorid | The ID of the actor to get the spawn point of |
| &skin | A variable into which to store the skin in, passed by reference. |
| &Float:spawnX | A float variable into which to store the spawnX in, passed by reference. |
| &Float:spawnY | A float variable into which to store the spawnY in, passed by reference. |
| &Float:spawnZ | A float variable into which to store the spawnZ in, passed by reference. |
| &Float:spawnAngle | A float variable into which to store the spawnAngle in, passed by reference. |

## Return Values

Returns **true** if the actor is valid, otherwise returns **false**.

## Examples

```c
new gMyActor;

public OnGameModeInit()
{
gMyActor = CreateActor(179, 1153.9640, -1772.3915, 16.5920, 0.0000);

new skin,
Float:spawnX,
Float:spawnY,
Float:spawnZ,
Float:spawnAngle;

GetActorSpawnInfo(gMyActor, skin, spawnX, spawnY, spawnZ, spawnAngle);
return 1;
}
```

## Related Functions

- [CreateActor](CreateActor): Create an actor (static NPC).
- [GetActorPos](GetActorPos): Get the position of an actor.
- [SetActorPos](SetActorPos): Set the position of an actor.
- [GetActorSkin](GetActorSkin): Get the skin of the actor.
- [SetActorSkin](SetActorSkin): Set the skin of the actor.
53 changes: 53 additions & 0 deletions docs/scripting/functions/GetPlayerCheckpoint.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: GetPlayerCheckpoint
description: Get the location of the current checkpoint.
tags: ["player", "checkpoint"]
---

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

## Description

Get the location of the current checkpoint.

| Name | Description |
| -------- | ---------------------------------------------------------------------------- |
| playerid | The ID of the player to get the checkpoint position of. |
| &Float:centreX | A float variable in which to store the centreX coordinate in, passed by reference. |
| &Float:centreY | A float variable in which to store the centreY coordinate in, passed by reference. |
| &Float:centreZ | A float variable in which to store the centreZ coordinate in, passed by reference. |
| &Float:radius | A float variable in which to store the radius in, passed by reference. |

## Returns

This function does not return any specific values.

## Examples

```c
SetPlayerCheckpoint(playerid, 408.9874, 2537.8059, 16.5455, 1.5);

new Float:centreX,
Float:centreY,
Float:centreZ,
Float:radius;

GetPlayerCheckpoint(playerid, centreX, centreY, centreZ, radius);
```
## Related Functions
- [SetPlayerCheckpoint](SetPlayerCheckpoint): Create a checkpoint for a player.
- [DisablePlayerCheckpoint](DisablePlayerCheckpoint): Disable the player's current checkpoint.
- [IsPlayerInCheckpoint](IsPlayerInCheckpoint): Check if a player is in a checkpoint.
- [IsPlayerCheckpointActive](IsPlayerCheckpointActive): Check if the player currently has a checkpoint visible.
- [SetPlayerRaceCheckpoint](SetPlayerRaceCheckpoint): Create a race checkpoint for a player.
- [DisablePlayerRaceCheckpoint](DisablePlayerRaceCheckpoint): Disable the player's current race checkpoint.
- [IsPlayerInRaceCheckpoint](IsPlayerInRaceCheckpoint): Check if a player is in a race checkpoint.
## Related Callbacks
- [OnPlayerEnterCheckpoint](../callbacks/OnPlayerEnterCheckpoint): Called when a player enters a checkpoint.
- [OnPlayerLeaveCheckpoint](../callbacks/OnPlayerLeaveCheckpoint): Called when a player leaves a checkpoint.
- [OnPlayerEnterRaceCheckpoint](../callbacks/OnPlayerEnterRaceCheckpoint): Called when a player enters a race checkpoint.
- [OnPlayerLeaveRaceCheckpoint](../callbacks/OnPlayerLeaveRaceCheckpoint): Called when a player leaves a race checkpoint.
44 changes: 44 additions & 0 deletions docs/scripting/functions/GetPlayerDialog.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
title: GetPlayerDialog
description: Get the ID of the dialog currently show to the player.
tags: ["player", "dialog"]
---

:::warning

This function is deprecated. Use [GetPlayerDialogID](GetPlayerDialogID).

:::

## Description

Get the ID of the dialog currently show to the player.

| Name | Description |
|----------|-----------------------|
| playerid | The ID of the player. |

## Return Values

Returns the dialog ID.

Or **INVALID_DIALOG_ID** if the player is not connected or has no dialog open.

## Examples

```c
new dialogID = GetPlayerDialog(playerid);
if (dialogID != INVALID_DIALOG_ID)
{
// The player has an open dialog
}
```

## Related Functions

- [GetPlayerDialogData](GetPlayerDialogData): Get the data of the dialog currently show to the player.
- [ShowPlayerDialog](ShowPlayerDialog): Shows the player a synchronous (only one at a time) dialog box.

## Related Callbacks

- [OnDialogResponse](../callbacks/OnDialogResponse): Called when a player responds to a dialog.
Loading

0 comments on commit eceedde

Please sign in to comment.