26.01.2010, 15:01
Eso, para u nserver TDM :P
#define TEAM_GROVE 1
#define TEAM_BALLA 2
#define TEAM_GROVE_COLOR 0x00FF00AA
#define TEAM_BALLA_COLOR 0xFF00FFAA
new gTeam[MAX_PLAYERS]; //variable golobal para almacenar el elquipo del jugador
public SetPlayerTeamFromClass(playerid, classid)
{
if (classid == 0)
{
gTeam[playerid] = TEAM_GROVE;
}
else
{
gTeam[playerid] = TEAM_BALLA;
}
}
public SetPlayerToTeamColor(playerid)
{
if (gTeam[playerid] == TEAM_GROVE)
{
SetPlayerColor(playerid, TEAM_GROVE_COLOR);
}
else if (gTeam[playerid] == TEAM_BALLA)
{
SetPlayerColor(playerid, TEAM_BALLA_COLOR);
}
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerTeamFromClass(playerid);
return 1;
}
public OnPlayerSpawn(playerid)
{
SetPlayerToTeamColor(playerid, classid);
}