AddPlayerClassEx

From SA-MP Wiki

Jump to: navigation, search


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


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 will face after spawning.
weapon1The first spawn-weapon for the player.
weapon1_ammoThe amount of ammunition for the first 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 that was just created.


Image:32px-Ambox_warning_orange.png Note: The maximum class id is 300, when you reach that limit, the new classes you create will overwrite the last one


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 may be useful, as they are related to this function in one way or another.

Personal tools