AddPlayerClassEx

From SA-MP Wiki

Jump to: navigation, search

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)
teamidThe Team you want the player to spawn in.
skinThe skin which the player will spawn with.
Float:XThe X-coordinate of the class' spawn position.
Float:YThe Y-coordinate of the class' spawn position.
Float:ZThe Z-coordinate of the class' spawn position.
Float:AngleThe direction in which the player needs to be facing after spawning.
weapon1The first spawn-weapon for the player.
weapon1_ammoThe amount of ammunition for the primary spawnweapon.
weapon2The second spawn-weapon for the player.
weapon2_ammoThe amount of ammunition for the second spawnweapon.
weapon3The third spawn-weapon for the player.
weapon3_ammoThe amount of ammunition for the third spawnweapon.


ReturnsThe 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.

Personal tools
In other languages