Skip to content

Commit

Permalink
Updated few functions bool tag and return values to bool (#823)
Browse files Browse the repository at this point in the history
* Updated ApplyActorAnimation.md, fixed the bools so people won't tag tag mismatch

Changed 0 to 'false', 1 to 'true' for all the bool tags

* Update SetObjectMaterialText.md, Fixed tag mismatch

* Update IsPlayerInAnyVehicle.md; Changed 0,1 to true false

* Update ApplyActorAnimation.md; 0,1 to bool

* Update ApplyActorAnimation.md added bool tag

* Update SetObjectMaterialText.md: bool tags updated

* Update ApplyAnimation.md; bool tags

* Update PlayerTextDrawSetProportional.md; bool tags

* Update PlayerTextDrawUseBox.md; bool tags

* Update TextDrawUseBox.md; bool tags

* Update PlayerTextDrawSetSelectable.md; bool tags

* Update ApplyActorAnimation.md; Added const

* Update ApplyActorAnimation.md

* Update ApplyAnimation.md added const and float

* Update PlayerTextDrawSetProportional.md tag fix

* Update PlayerTextDrawUseBox.md; tag fixes

* Update SetObjectMaterialText.md; tags

* Update TextDrawUseBox.md; tags
  • Loading branch information
Arose-Niazi authored Jan 11, 2024
1 parent c162416 commit 0b523a4
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 56 deletions.
28 changes: 14 additions & 14 deletions docs/scripting/functions/ApplyActorAnimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ tags: ["actor"]

Apply an animation to an actor.

| Name | Description |
| ---------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| actorid | The ID of the actor to apply the animation to. |
| animlib[] | The animation library from which to apply an animation. |
| animname[] | The name of the animation to apply, within the specified library. |
| fDelta | The speed to play the animation (use 4.1). |
| loop | If set to 1, the animation will loop. If set to 0, the animation will play once. |
| lockx | If set to 0, the actor is returned to their old X coordinate once the animation is complete (for animations that move the actor such as walking). 1 will not return them to their old position. |
| locky | Same as above but for the Y axis. Should be kept the same as the previous parameter. |
| freeze | Setting this to 1 will freeze an actor at the end of the animation. 0 will not. |
| time | Timer in milliseconds. For a never-ending loop it should be 0. |
| Name | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| actorid | The ID of the actor to apply the animation to. |
| const animlib[] | The animation library from which to apply an animation. |
| const animname[] | The name of the animation to apply, within the specified library. |
| float:fDelta | The speed to play the animation (use 4.1). |
| bool:loop | If set to true, the animation will loop. If set to false, the animation will play once. |
| bool:lockx | If set to false, the actor is returned to their old X coordinate once the animation is complete (for animations that move the actor such as walking). true will not return them to their old position. |
| bool:locky | Same as above but for the Y axis. Should be kept the same as the previous parameter. |
| bool:freeze | Setting this to true will freeze an actor at the end of the animation. false will not. |
| time | Timer in milliseconds. For a never-ending loop it should be 0. |

## Returns

1: The function executed successfully.
true: The function executed successfully.

0: The function failed to execute. The actor specified does not exist.
false: The function failed to execute. The actor specified does not exist.

## Examples

Expand All @@ -36,7 +36,7 @@ new gMyActor;
public OnGameModeInit()
{
gMyActor = CreateActor(179, 316.1, -134.0, 999.6, 90.0); // Actor as salesperson in Ammunation
ApplyActorAnimation(gMyActor, "DEALER", "shop_pay", 4.1, 0, 0, 0, 0, 0); // Pay anim
ApplyActorAnimation(gMyActor, "DEALER", "shop_pay", 4.1, false, false, false, false, 0); // Pay anim
return 1;
}
```
Expand Down
24 changes: 12 additions & 12 deletions docs/scripting/functions/ApplyAnimation.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ tags: ["player", "animation"]
Apply an animation to a player.

| Name | Description |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | The ID of the player to apply the animation to. |
| animlib[] | The [animation library](../resources/animations) from which to apply an animation. |
| animname[] | The name of the animation to apply, within the specified library. |
| fDelta | The speed to play the animation (use 4.1). |
| loop | If set to 'true', the animation will loop. If set to 'false', the animation will play once. |
| lockx | If set to 'false', the player is returned to their old X coordinate once the animation is complete (for animations that move the player such as walking). 'true' will not return them to their old position. |
| locky | Same as above but for the Y axis. Should be kept the same as the previous parameter. |
| freeze | Setting this to 'true' will freeze the player at the end of the animation. 'false' will not. |
| time | Timer in milliseconds. For a never-ending loop it should be 0. |
| forcesync | Set to 1 to make server sync the animation with all other players in streaming radius (optional). 2 works same as 1, but will ONLY apply the animation to streamed-in players, but NOT the actual player being animated (useful for npc animations and persistent animations when players are being streamed) |
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| playerid | The ID of the player to apply the animation to. |
| const animlib[] | The [animation library](../resources/animations) from which to apply an animation. |
| const animname[] | The name of the animation to apply, within the specified library. |
| float:fDelta | The speed to play the animation (use 4.1). |
| bool:loop | If set to 'true', the animation will loop. If set to 'false', the animation will play once. |
| bool:lockx | If set to 'false', the player is returned to their old X coordinate once the animation is complete (for animations that move the player such as walking). 'true' will not return them to their old position. |
| bool:locky | Same as above but for the Y axis. Should be kept the same as the previous parameter. |
| bool:freeze | Setting this to 'true' will freeze the player at the end of the animation. 'false' will not. |
| time | Timer in milliseconds. For a never-ending loop it should be 0. |
| forcesync | Set to 1 to make server sync the animation with all other players in streaming radius (optional). 2 works same as 1, but will ONLY apply the animation to streamed-in players, but NOT the actual player being animated (useful for npc animations and persistent animations when players are being streamed) |

## Returns

This function always returns 1, even if the player specified does not exist, or any of the parameters are invalid (e.g. invalid library).
This function always returns true, even if the player specified does not exist, or any of the parameters are invalid (e.g. invalid library).

## Examples

Expand Down
4 changes: 2 additions & 2 deletions docs/scripting/functions/IsPlayerInAnyVehicle.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ Check if a player is inside any vehicle (as a driver or passenger).

## Returns

1: The player is in a vehicle.
true: The player is in a vehicle.

0: The player is not in a vehicle.
false: The player is not in a vehicle.

## Examples

Expand Down
6 changes: 3 additions & 3 deletions docs/scripting/functions/PlayerTextDrawSetProportional.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Appears to scale text spacing to a proportional ratio. Useful when using PlayerT

| Name | Description |
| -------- | ------------------------------------------------------------------------ |
| playerid | The ID of the player whose player-textdraw to set the proportionality of |
| text | The ID of the player-textdraw to set the proportionality of |
| set | 1 to enable proportionality, 0 to disable. |
| playerid | The ID of the player whose player-textdraw to set the proportionality of |
| PlayerText:text | The ID of the player-textdraw to set the proportionality of |
| bool:set | true to enable proportionality, false to disable. |

## Returns

Expand Down
10 changes: 5 additions & 5 deletions docs/scripting/functions/PlayerTextDrawSetSelectable.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ tags: ["player", "textdraw", "playertextdraw"]

Toggles whether a player-textdraw can be selected or not.

| Name | Description |
| --------------- | ----------------------------------------------------------------------------------- |
| playerid | The ID of the player whose player-textdraw to set the selectability of. |
| PlayerText:text | The ID of the player-textdraw to set the selectability of. |
| set | Set the player-textdraw selectable (1) or non-selectable (0). By default this is 0. |
| Name | Description |
| --------------- | ------------------------------------------------------------------------------------------------ |
| playerid | The ID of the player whose player-textdraw to set the selectability of. |
| PlayerText:text | The ID of the player-textdraw to set the selectability of. |
| bool:set | Set the player-textdraw selectable 'true' or non-selectable 'false'. By default this is 'false'. |

## Returns

Expand Down
6 changes: 3 additions & 3 deletions docs/scripting/functions/PlayerTextDrawUseBox.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ Toggle the box on a player-textdraw.

| Name | Description |
| -------- | -------------------------------------------------------- |
| playerid | The ID of the player whose textdraw to toggle the box of |
| text | The ID of the player-textdraw to toggle the box of |
| use | 1 to use a box or 0 to not use a box |
| playerid | The ID of the player whose textdraw to toggle the box of |
| PlayerText:text | The ID of the player-textdraw to toggle the box of |
| bool:use | true to use a box or false to not use a box |

## Returns

Expand Down
28 changes: 14 additions & 14 deletions docs/scripting/functions/SetObjectMaterialText.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,23 @@ Replace the texture of an object with text.

| Name | Description |
|------------------|-----------------------------------------------------------------------------------------------|
| objectid | The ID of the object to replace the texture of with text. |
| text[] | The text to show on the object. (MAX 2048 characters) |
| materialindex | The object's material index to replace with text. |
| materialsize | The [size](/docs/scripting/resources/materialtextsizes) of the material. |
| fontface | The font to use. |
| fontsize | The size of the text (MAX 255). |
| bold | Bold text. Set to 1 for bold, 0 for not. |
| fontcolor | The color of the text, in ARGB format. |
| backcolor | The background color, in ARGB format. |
| textalignment | The [alignment](/docs/scripting/resources/materialtextalignment) of the text (default: left). |
| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. |
| objectid | The ID of the object to replace the texture of with text. |
| text[] | The text to show on the object. (MAX 2048 characters) |
| materialindex | The object's material index to replace with text. |
| OBJECT_MATERIAL_SIZE:materialsize | The [size](/docs/scripting/resources/materialtextsizes) of the material. |
| const fontface | The font to use. |
| fontsize | The size of the text (MAX 255). |
| bool:bold | Bold text. Set to true for bold, false for not. |
| fontcolor | The color of the text, in ARGB format. |
| backcolor | The background color, in ARGB format. |
| OBJECT_MATERIAL_TEXT_ALIGN:textalignment | The [alignment](/docs/scripting/resources/materialtextalignment) of the text (default: left). |
| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. |

## Returns

1: The function was executed successfully.
true: The function was executed successfully.

0: The function failed to execute.
false: The function failed to execute.

## Examples

Expand All @@ -37,7 +37,7 @@ if (strcmp("/text", cmdtext, true) == 0)
{
new objectId = CreateObject(19353, 0, 0, 10, 0.0, 0.0, 90.0); //create the object
SetObjectMaterialText(objectId, "SA-MP {FFFFFF}0.3{008500}e {FF8200}RC7", 0, OBJECT_MATERIAL_SIZE_256x128,
"Arial", 28, 0, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
"Arial", 28, false, 0xFFFF8200, 0xFF000000, OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
// write "SA-MP 0.3e RC7" on the object, with orange font color and black background
return 1;
}
Expand Down
Loading

0 comments on commit 0b523a4

Please sign in to comment.