-
Notifications
You must be signed in to change notification settings - Fork 372
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 #791 from adib-yg/master
Added more scripting functions documents
- Loading branch information
Showing
49 changed files
with
1,108 additions
and
13 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
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,35 @@ | ||
--- | ||
title: AllowPlayerWeapons | ||
description: Enable/Disable weapons for a player. | ||
tags: ["player"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Enable/Disable weapons for a player. | ||
|
||
| Name | Description | | ||
| -------- | ----------------------------------------------------- | | ||
| playerid | The ID of the player to allow weapons | | ||
| bool:allow | true for allow and false for disallow. | | ||
|
||
## Returns | ||
|
||
This function always returns true. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnPlayerConnect(playerid) | ||
{ | ||
AllowPlayerWeapons(playerid, true); | ||
|
||
return 1; | ||
} | ||
``` | ||
## Related Functions | ||
- [ArePlayerWeaponsAllowed](ArePlayerWeaponsAllowed): Can the player use weapons? |
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: ArePlayerWeaponsAllowed | ||
description: Can the player use weapons? | ||
tags: ["player"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Can the player use weapons? | ||
|
||
| Name | Description | | ||
| -------- | ----------------------------------------------------------- | | ||
| playerid | The ID of the player to check. | | ||
|
||
## Returns | ||
|
||
true: Allow. | ||
|
||
false: Disallow. | ||
|
||
## Examples | ||
|
||
```c | ||
public OnPlayerSpawn(playerid) | ||
{ | ||
if (ArePlayerWeaponsAllowed(playerid)) | ||
{ | ||
// do something | ||
} | ||
|
||
return 1; | ||
} | ||
``` | ||
## Related Functions | ||
- [AllowPlayerWeapons](AllowPlayerWeapons): Enable/Disable weapons for 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
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,40 @@ | ||
--- | ||
title: EditPlayerClass | ||
description: Edit a class data. | ||
tags: ["class"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Edit a class data. | ||
|
||
| Name | Description | | ||
| ------------- | ------------------------------------------------------------- | | ||
| classid | The class id to edit. | | ||
| team | The team you want the player to spawn in. | | ||
| skin | The skin which the player will spawn with. | | ||
| Float:spawnX | The X coordinate of the spawnpoint of this class. | | ||
| Float:spawnY | The Y coordinate of the spawnpoint of this class. | | ||
| Float:spawnZ | The Z coordinate of the spawnpoint of this class. | | ||
| Float:angle | The direction in which the player will face after spawning. | | ||
| WEAPON:weapon1 | The first spawn-weapon for the player. | | ||
| ammo1 | The amount of ammunition for the first spawn weapon. | | ||
| WEAPON:weapon2 | The second spawn-weapon for the player. | | ||
| ammo2 | The amount of ammunition for the second spawn weapon. | | ||
| WEAPON:weapon3 | The third spawn-weapon for the player. | | ||
| ammo3 | The amount of ammunition for the third spawn weapon. | | ||
|
||
## Examples | ||
|
||
```c | ||
// Edit class id 10 | ||
EditPlayerClass(10, TEAM_NONE, 299, -253.8291, 2602.9312, 62.8527, -90.0000, WEAPON_KNIFE, 1, WEAPON_MP5, 100, WEAPON_COLT45, 20); | ||
``` | ||
## Related Functions | ||
- [AddPlayerClass](AddPlayerClass): Adds a class. | ||
- [AddPlayerClassEx](AddPlayerClassEx): Add a class with a default team. | ||
- [GetAvailableClasses](GetAvailableClasses): Get the number of classes defined. |
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,23 @@ | ||
--- | ||
title: GetAvailableClasses | ||
description: Get the number of classes defined. | ||
tags: ["class"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get the number of classes defined. | ||
|
||
## Examples | ||
|
||
```c | ||
printf("Available classes: %d", GetAvailableClasses()); | ||
``` | ||
## Related Functions | ||
- [AddPlayerClass](AddPlayerClass): Adds a class. | ||
- [AddPlayerClassEx](AddPlayerClassEx): Add a class with a default team. | ||
- [EditPlayerClass](EditPlayerClass): Edit a class data. |
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,41 @@ | ||
--- | ||
title: GetCustomModelPath | ||
description: Get a custom model path. | ||
tags: [] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get a custom model path. | ||
|
||
| Name | Description | | ||
| ------------- | ------------------------------------------------------------- | | ||
| modelid | The custom model id to get path from. | | ||
| dffPath[] | An array in which to store the dffPath in, passed by reference. | | ||
| dffSize | The length of the dffPath that should be stored. | | ||
| txdPath[] | An array in which to store the txdPath in, passed by reference. | | ||
| txdSize | The length of the txdPath that should be stored. | | ||
|
||
## Examples | ||
|
||
```c | ||
new | ||
modelid = -2000, | ||
dffPath[64], | ||
txdPath[64]; | ||
|
||
GetCustomModelPath(modelid, dffPath, sizeof(dffPath), txdPath, sizeof(txdPath)); | ||
|
||
printf("[Custom model id %d path]\n\ | ||
dff: %s\n\ | ||
txd: %s", | ||
modelid, dffPath, txdPath); | ||
``` | ||
## Related Functions | ||
- [AddSimpleModel](AddSimpleModel): Adds a new custom simple object model. | ||
- [AddSimpleModelTimed](AddSimpleModelTimed): Adds a new custom simple object model. | ||
- [IsValidCustomModel](IsValidCustomModel): Checks if a custom model ID 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
--- | ||
title: GetMenuColumnHeader | ||
description: Get the text in the header of the specified column. | ||
tags: ["menu"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get the text in the header of the specified column. | ||
|
||
| Name | Description | | ||
| --------- | ----------------------------------------------------------------- | | ||
| Menu:menuid | The ID of the menu. | | ||
| column | The column. | | ||
| header[] | An array into which to store the text, passed by reference. | | ||
| len | The length of the text that should be stored. | | ||
|
||
## Returns | ||
|
||
This function always returns true. | ||
|
||
## Examples | ||
|
||
```c | ||
new text[32]; | ||
|
||
// Get the menu header text in the column 1 | ||
GetMenuColumnHeader(menuid, 1, text, sizeof(text)); | ||
``` | ||
## Related Functions | ||
- [CreateMenu](CreateMenu): Creates a menu. |
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: GetMenuColumnWidth | ||
description: Get the width of the one or two columns. | ||
tags: ["menu"] | ||
--- | ||
|
||
<VersionWarn version='omp v1.1.0.2612' /> | ||
|
||
## Description | ||
|
||
Get the width of the one or two columns. | ||
|
||
| Name | Description | | ||
| --------- | ----------------------------------------------------------------- | | ||
| Menu:menuid | The ID of the menu. | | ||
| &Float:column1Width | A float variable in which to store the column1 width in, passed by reference. | | ||
| &Float:column2Width | A float variable in which to store the column2 width in, passed by reference. | | ||
|
||
## Returns | ||
|
||
This function always returns true. | ||
|
||
## Examples | ||
|
||
```c | ||
new Float:column1Width, Float:column2Width; | ||
GetMenuColumnWidth(menuid, column1Width, column2Width); | ||
|
||
// Or you can only get column1 width | ||
new Float:column1Width; | ||
GetMenuColumnWidth(menuid, column1Width); | ||
``` | ||
## Related Functions | ||
- [GetMenuPos](GetMenuPos): Get the x/y screen position of the menu. |
Oops, something went wrong.