From SA-MP
AddPlayerClass
In order to allow people to spawn with a specific skin using the class-selection screens, this is the function to use. At least one skin needs to be defined in your gamemode in order for it to run. If you would like to add a default team for a skin, take a look at
AddPlayerClassEx.
(skin, Float:x, Float:y, Float:z, Float:Angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo)
| 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.
AddPlayerClass( 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.
- SetPlayerSkin: The SetPlayerSkin function allows you to change a player's appearance.
- SetSpawnInfo: To adjust the spawn information of a specific player.