AddPlayerClassEx
Description:
Function AddPlayerClassEx is exactly the same as the AddPlayerClass function, with the addition of a team parameter.
The maximum class ID is 319 (starting from 0, so a total of 320 classes). When this limit is reached, any more classes that are added will replace ID 319. |
Parameters:
(teamid, modelid, Float:spawn_x, Float:spawn_y, Float:spawn_z, Float:z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
int | teamid | The team you want the player to spawn in. |
int | 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. |
int | weapon1 | The first spawn-weapon for the player. |
int | weapon1_ammo | The amount of ammunition for the primary spawn weapon. |
int | weapon2 | The second spawn-weapon for the player. |
int | weapon2_ammo | The amount of ammunition for the second spawn weapon. |
int | weapon3 | The third spawn-weapon for the player. |
int | weapon3_ammo | The amount of ammunition for the third spawn weapon. |
Return Values:
- The ID of the class which was just added.
- 319 if the class limit (320) was reached. The highest possible class ID is 319.
Examples:
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 return 1; }
Related Functions
The following functions may be useful, as they are related to this function in one way or another.
- AddPlayerClass: Add a class.
- SetSpawnInfo: Set the spawn setting for a player.
- SetPlayerTeam: Set a player's team.
- SetPlayerSkin: Set a player's skin.