跳至主要内容

AddPlayerClassEx

Description

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

NameDescription
teamThe team you want the player to spawn in.
skinThe skin which the player will spawn with.
Float:spawnXThe X coordinate of the spawnpoint of this class.
Float:spawnYThe Y coordinate of the spawnpoint of this class.
Float:spawnZThe Z coordinate of the spawnpoint of this class.
Float:angleThe direction in which the player should face after spawning.
WEAPON:weapon1The first spawn-weapon for the player.
ammo1The amount of ammunition for the primary spawn weapon.
WEAPON:weapon2The second spawn-weapon for the player.
ammo2The amount of ammunition for the second spawn weapon.
WEAPON:weapon3The third spawn-weapon for the player.
ammo3The amount of ammunition for the third spawn weapon.

Returns

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, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // CJ
AddPlayerClassEx(2, 1, 1958.33, 1343.12, 15.36, 269.15, WEAPON_SAWEDOFF, 36, WEAPON_UZI, 150, WEAPON_FIST, 0); // The Truth
return 1;
}

Notes

提示

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.