-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added more core scripting functions documents. (#794)
* add AddServerRule.md * add RemoveServerRule.md * add IsValidServerRule.md * add AllowNickNameCharacter.md * add IsValidNickName.md * add ToggleChatTextReplacement.md * add ChatTextReplacementToggled.md * add EnableAllAnimations.md * add IsValidAnimationLibrary.md * add tags for IsValidAnimationLibrary.md * add AreAllAnimationsEnabled.md * add AreInteriorWeaponsAllowed.md * add IsAdminTeleportAllowed.md * add IsBanned.md * add ClearBanList.md * add HideGameTextForPlayer.md * add HideGameTextForAll.md * add GetPlayerWeather.md * add GetWeather.md * add GetWorldTime.md * add CountRunningTimers.md * add GetRunningTimers.md * add GetPlayers.md * update callbacks/OnPlayerText.md * update AllowAdminTeleport.md * update AllowInteriorWeapons.md * update ApplyAnimation.md * update BlockIpAddress.md * update UnBlockIpAddress.md * update GameTextForAll.md * update GameTextForPlayer.md * update GetPlayerName.md * update SetPlayerName.md * update SetPlayerWeather.md * update KillTimer.md * update SetTimer.md * update SetTimerEx.md * update SetWeather.md * update SetWorldTime.md * update GetPlayers.md * add GetVehicles.md * add GetActors.md * update IsAdminTeleportAllowed.md
- Loading branch information
Showing
40 changed files
with
915 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
--- | ||
title: AddServerRule | ||
description: Add a server rule. | ||
tags: ["rule"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Add a server rule. | ||
|
||
| Name | Description | | ||
| ----------------- | ----------------------------------------------------------- | | ||
| const rule[] | The server rule name to add. | | ||
| const format[] | The server rule value. | | ||
| OPEN_MP_TAGS:... | Indefinite number of arguments of any tag. | | ||
|
||
## Returns | ||
|
||
Returns true if the function executed successfully, otherwise false. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnGameModeInit() | ||
{ | ||
AddServerRule("discord", "discord.gg/samp"); | ||
return 1; | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [RemoveServerRule](RemoveServerRule): Remove the server rule. | ||
- [IsValidServerRule](IsValidServerRule): Checks if the given server rule is valid. |
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,39 @@ | ||
--- | ||
title: AllowNickNameCharacter | ||
description: Allows a character to be used in the nick name. | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Allows a character to be used in the nick name. | ||
|
||
| Name | Description | | ||
| -------- | --------------------------------------- | | ||
| character | The character to allow or disallow. | | ||
| bool:allow | true-Allow, false-Disallow | | ||
|
||
## Returns | ||
|
||
This function does not return any specific values. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnGameModeInit() | ||
{ | ||
AllowNickNameCharacter('*', true); // Allow char * | ||
AllowNickNameCharacter('[', false); // Disallow char [ | ||
AllowNickNameCharacter(']', false); // Disallow char ] | ||
|
||
return 1; | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [IsValidNickName](IsValidNickName): Checks if a nick name is valid. | ||
- [SetPlayerName](SetPlayerName): Sets the name of a player. | ||
- [GetPlayerName](GetPlayerName): Gets the name of a player. |
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,36 @@ | ||
--- | ||
title: AreAllAnimationsEnabled | ||
description: Are the animations missing from some versions enabled? | ||
tags: ["animation"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Are the animations missing from some versions enabled? | ||
|
||
## Returns | ||
|
||
true: Enable. | ||
|
||
false: False. | ||
|
||
## Examples | ||
|
||
```c | ||
if (AreAllAnimationsEnabled()) | ||
{ | ||
// Do something | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [EnableAllAnimations](EnableAllAnimations): Allow use of the animations missing from some versions. | ||
- [ApplyAnimation](ApplyAnimation): Apply an animation to a player. | ||
- [ClearAnimations](ClearAnimations): Clear any animations a player is performing. | ||
|
||
## Related Resources | ||
|
||
- [Animations](../resources/animations) |
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,30 @@ | ||
--- | ||
title: AreInteriorWeaponsAllowed | ||
description: Can weapons be used in interiors? | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Can weapons be used in interiors? | ||
|
||
## Returns | ||
|
||
true: Allowed. | ||
|
||
false: Not allowed. | ||
|
||
## Examples | ||
|
||
```c | ||
if (AreInteriorWeaponsAllowed()) | ||
{ | ||
// Do something | ||
} | ||
``` | ||
|
||
## Related Functions | ||
|
||
- [AllowInteriorWeapons](AllowInteriorWeapons): Toggle whether the usage of weapons in interiors is allowed or not. |
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,27 @@ | ||
--- | ||
title: ChatTextReplacementToggled | ||
description: Checks if the chat input filtering is enabled or disabled. | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Checks if the chat input filtering is enabled or disabled. | ||
|
||
## Returns | ||
|
||
true: Enable. | ||
|
||
false: Disable. | ||
|
||
## Examples | ||
|
||
```c | ||
printf("Chat input filter is %s", ChatTextReplacementToggled() ? "Enable" : "Disable"); | ||
``` | ||
## Related Functions | ||
- [ToggleChatTextReplacement](ToggleChatTextReplacement): Toggles the chat input filter. |
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,54 @@ | ||
--- | ||
title: ClearBanList | ||
description: Clears the ban list. | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Clears the ban list. | ||
|
||
## Returns | ||
|
||
false: Failed to execute the function. | ||
|
||
true: Success. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnPlayerCommandText(playerid, cmdtext[]) | ||
{ | ||
if (!strcmp(cmdtext, "/clearbanlist", true)) | ||
{ | ||
if (!IsPlayerAdmin(playerid)) | ||
{ | ||
return 1; | ||
} | ||
|
||
ClearBanList(); | ||
SendClientMessage(playerid, -1, "[SERVER]: Ban list cleared."); | ||
return 1; | ||
} | ||
return 0; | ||
} | ||
``` | ||
## Notes | ||
:::tip | ||
You can see the ban list in the bans.json file. | ||
::: | ||
## Related Functions | ||
- [BlockIpAddress](BlockIpAddress): Block an IP address from connecting to the server for a set amount of time. | ||
- [UnBlockIpAddress](UnBlockIpAddress): Unblock an IP that was previously blocked. | ||
- [Ban](Ban): Ban a player from playing on the server. | ||
- [BanEx](BanEx): Ban a player with a custom reason. | ||
- [Kick](Kick): Kick a player from the server. | ||
- [IsBanned](IsBanned): Checks if the given IP address is banned. |
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,27 @@ | ||
--- | ||
title: CountRunningTimers | ||
description: Get the running timers. | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get the running timers. ([SetTimer](SetTimer) & [SetTimerEx](SetTimerEx)) | ||
|
||
## Returns | ||
|
||
Returns the amount of running timers. | ||
|
||
## Examples | ||
|
||
```c | ||
printf("Running timers: %d", CountRunningTimers()); | ||
``` | ||
## Related Functions | ||
- [SetTimer](SetTimer): Set a timer. | ||
- [SetTimerEx](SetTimerEx): Set a timer with parameters. | ||
- [KillTimer](KillTimer): Kills (stops) a running timer. |
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,53 @@ | ||
--- | ||
title: EnableAllAnimations | ||
description: Allow use of the animations missing from some versions. | ||
tags: ["animation"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Allow use of the animations missing from some versions. | ||
|
||
| Name | Description | | ||
| ------ | ----------------------------------------------- | | ||
| bool:enable | 'true' to enable missing animations or 'false' to disable them. | | ||
|
||
## Returns | ||
|
||
This function does not return any specific values. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnGameModeInit() | ||
{ | ||
EnableAllAnimations(true); | ||
return 1; | ||
} | ||
``` | ||
|
||
## Notes | ||
|
||
:::tip | ||
|
||
You can also enable or disable missing animations from the config.json file. | ||
|
||
```json | ||
"game": { | ||
"use_all_animations": false, | ||
}, | ||
``` | ||
|
||
::: | ||
|
||
## Related Functions | ||
|
||
- [AreAllAnimationsEnabled](AreAllAnimationsEnabled): Are the animations missing from some versions enabled? | ||
- [ApplyAnimation](ApplyAnimation): Apply an animation to a player. | ||
- [ClearAnimations](ClearAnimations): Clear any animations a player is performing. | ||
|
||
## Related Resources | ||
|
||
- [Animations](../resources/animations) |
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
Oops, something went wrong.