Skip to content

Commit

Permalink
Merge pull request #838 from adib-yg/master
Browse files Browse the repository at this point in the history
Update several docs
  • Loading branch information
adib-yg authored Jan 16, 2024
2 parents fca1bc7 + e187212 commit 20a0fa0
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 49 deletions.
30 changes: 15 additions & 15 deletions docs/scripting/functions/AddPlayerClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ tags: ["player", "class"]

Adds a class to class selection. Classes are used so players may spawn with a skin of their choice.

| Name | Description |
| ------------- | ------------------------------------------------------------- |
| modelid | The skin which the player will spawn with. |
| Float:spawn_x | The X coordinate of the spawnpoint of this class. |
| Float:spawn_y | The Y coordinate of the spawnpoint of this class. |
| Float:spawn_z | The Z coordinate of the spawnpoint of this class. |
| Float:z_angle | The direction in which the player should face after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| weapon1_ammo | The amount of ammunition for the primary spawn weapon. |
| weapon2 | The second spawn-weapon for the player. |
| weapon2_ammo | The amount of ammunition for the second spawn weapon. |
| weapon3 | The third spawn-weapon for the player. |
| weapon3_ammo | The amount of ammunition for the third spawn weapon. |
| Name | Description |
|--------------|---------------------------------------------------------------|
| 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 should face after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| ammo1 | The amount of ammunition for the primary spawn weapon. |
| weapon2 | The second spawn-weapon for the player. |
| ammo2 | The amount of ammunition for the second spawn weapon. |
| weapon3 | The third spawn-weapon for the player. |
| ammo3 | The amount of ammunition for the third spawn weapon. |

## Returns

Expand All @@ -34,8 +34,8 @@ The ID of the class which was just added.
public OnGameModeInit()
{
// Players can spawn with either the CJ skin (0) or The Truth skin (1).
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ
AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth
AddPlayerClass(0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_BRASSKNUCKLE, 1); // CJ
AddPlayerClass(1, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_BRASSKNUCKLE, 1); // The Truth
return 1;
}
```
Expand Down
32 changes: 16 additions & 16 deletions docs/scripting/functions/AddPlayerClassEx.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,20 @@ tags: ["player", "class"]

This function is exactly the same as the AddPlayerClass function, with the addition of a team parameter.

| Name | Description |
| ------------- | ----------------------------------------------------------- |
| teamid | The team you want the player to spawn in. |
| modelid | The skin which the player will spawn with. |
| Float:spawn_x | The X coordinate of the class' spawn position. |
| Float:spawn_y | The Y coordinate of the class' spawn position. |
| Float:spawn_z | The Z coordinate of the class' spawn position. |
| Float:z_angle | The direction in which the player will face after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| weapon1_ammo | The amount of ammunition for the first spawn weapon. |
| weapon2 | The second spawn-weapon for the player. |
| weapon2_ammo | The amount of ammunition for the second spawn weapon. |
| weapon3 | The third spawn-weapon for the player. |
| weapon3_ammo | The amount of ammunition for the third spawn weapon. |
| Name | Description |
|--------------|---------------------------------------------------------------|
| 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 should face after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| ammo1 | The amount of ammunition for the primary spawn weapon. |
| weapon2 | The second spawn-weapon for the player. |
| ammo2 | The amount of ammunition for the second spawn weapon. |
| weapon3 | The third spawn-weapon for the player. |
| ammo3 | The amount of ammunition for the third spawn weapon. |

## Returns

Expand All @@ -37,8 +37,8 @@ public OnGameModeInit()
// Players can spawn as either:
// CJ Skin (ID 0) in team 1.
// The Truth skin (ID 1) in team 2.
AddPlayerClassEx(1, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // CJ
AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0); // The Truth
AddPlayerClassEx(1, 0, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // CJ
AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // The Truth
return 1;
}
```
Expand Down
4 changes: 4 additions & 0 deletions docs/scripting/functions/GetPlayerWeapon.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,7 @@ Sometimes the result can be -1 which is an invalid weapon ID. Circumstances of t
- [GetPlayerWeaponData](GetPlayerWeaponData): Find out information about weapons a player has.
- [GivePlayerWeapon](GivePlayerWeapon): Give a player a weapon.
- [ResetPlayerWeapons](ResetPlayerWeapons): Remove all weapons from a player.
## Related Resources
- [Weapon IDs](../resources/weaponids)
3 changes: 2 additions & 1 deletion docs/scripting/functions/GetPlayerWeaponData.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ Old weapons with no ammo left are still returned.
## Related Resources
- [Weapon Slots](../resources/weaponslots).
- [Weapon Slots](../resources/weaponslots)
- [Weapon IDs](../resources/weaponids)
34 changes: 17 additions & 17 deletions docs/scripting/functions/SetSpawnInfo.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,23 @@ tags: ["player"]

## Description

This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using SetPlayerSkin in OnPlayerSpawn and/or OnPlayerRequestClass, even though this has been fixed in 0.2.

| Name | Description |
| -------------- | -------------------------------------------------------------------- |
| playerid | The PlayerID of who you want to set the spawn information. |
| team | The Team-ID of the chosen player. |
| skin | The skin which the player will spawn with. |
| Float:X | The X-coordinate of the player's spawn position. |
| Float:Y | The Y-coordinate of the player's spawn position. |
| Float:Z | The Z-coordinate of the player's spawn position. |
| Float:rotation | The direction in which the player needs to be facing after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| weapon1_ammo | The amount of ammunition for the primary spawnweapon. |
| weapon2 | The second spawn-weapon for the player. |
| weapon2_ammo | The amount of ammunition for the second spawnweapon. |
| weapon3 | The third spawn-weapon for the player. |
| weapon3_ammo | The amount of ammunition for the third spawnweapon. |
This function can be used to change the spawn information of a specific player. It allows you to automatically set someone's spawn weapons, their team, skin and spawn position, normally used in case of minigames or automatic-spawn systems. This function is more crash-safe then using SetPlayerSkin in [OnPlayerSpawn](../callbacks/OnPlayerSpawn) and/or [OnPlayerRequestClass](../callbacks/OnPlayerRequestClass), even though this has been fixed in 0.2.

| Name | Description |
|--------------|----------------------------------------------------------------------|
| playerid | The PlayerID of who you want to set the spawn information. |
| team | The Team-ID of the chosen player. |
| skin | The skin which the player will spawn with. |
| Float:spawnX | The X-coordinate of the player's spawn position. |
| Float:spawnY | The Y-coordinate of the player's spawn position. |
| Float:spawnZ | The Z-coordinate of the player's spawn position. |
| Float:angle | The direction in which the player needs to be facing after spawning. |
| weapon1 | The first spawn-weapon for the player. |
| ammo1 | The amount of ammunition for the primary spawnweapon. |
| weapon2 | The second spawn-weapon for the player. |
| ammo2 | The amount of ammunition for the second spawnweapon. |
| weapon3 | The third spawn-weapon for the player. |
| ammo3 | The amount of ammunition for the third spawnweapon. |

## Returns

Expand Down

0 comments on commit 20a0fa0

Please sign in to comment.