12.07.2018, 01:03
a team is nothing else than a collection of player classes, just look at the first parameter of AddPlayerClassEx
Before Set / GetPlayerTeam were introduced the teams were set in OnPlayerRequestClass by mapping the classids to teams
Thats for static teams, dynamic teams like gangs or clans in freeroam modes get the teamid set in "join / accept" commands and at login
Quote:
AddPlayerClassEx(teamid, modelid, Float: spawn_x, Float: spawn_y, Float: spawn_z, Float: z_angle, weapon1, weapon1_ammo, weapon2, weapon2_ammo, weapon3, weapon3_ammo) |
PHP код:
enum {
TEAM_BLUE,
TEAM_RED
}
new gTeam[MAX_PLAYEERS];
public OnPlayerRequestClass(playerid,classid)
{
switch(classid) {
case 0..2: gTeam[playerid] = TEAM_BLUE;
case 3..7: gTeam[playerid] = TEAM_RED;
}
return 1;
}