From SA-MP Wiki
AddPlayerClassEx
This function is exactly the same as the
AddPlayerClass function, with the addition that players who choose this class will automatically be set in the team you're assigning to it. The team can be defined using the first parameter of this function.
Parameters:(teamid, skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
| teamid | The Team you want the player to spawn in. |
| skin | The skin which the player will spawn with. |
| Float:X | The X-coordinate of the class' spawn position. |
| Float:Y | The Y-coordinate of the class' spawn position. |
| Float:Z | The Z-coordinate of the class' spawn position. |
| Float:Angle | 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. |
| Returns | The ID of the class which was just created. |
public OnGameModeInit( )
{
// People are only allowed to spawn using the CJ skin, and in team 15.
AddPlayerClassEx( 15, 0, 1958.33, 1343.12, 15.36, 269.15, 26, 36, 28, 150, 0, 0);
return 1;
}
Related Functions
The following functions might be useful as well, as they're related to this function in one way or another.