22.02.2012, 01:29
This should do it.
Naskripto sam ti ovo, al svejedno si budala <3
Naskripto sam ti ovo, al svejedno si budala <3
pawn Код:
#define TEAM_SWAT (0)
#define TEAM_TERROR (1)
#define TEAM_SWAT_COLOR (0xFF4600FF)
#define TEAM_TERROR_COLOR (0x0091FFFF)
new gTeamCount[2];
public OnPlayerConnect(playerid)
{
SetPlayerTeam(playerid, NO_TEAM);
return 1;
}
public OnPlayerRequestSpawn(playerid)
{
SetPlayerInterior(playerid, 0);
new playerSkin = GetPlayerSkin(playerid);
switch(playerSkin)
{
case 121:
{
SetPlayerTeam(playerid, TEAM_SWAT);
SetPlayerColor(playerid, TEAM_SWAT_COLOR);
if((gTeamCount[TEAM_SWAT]++ > gTeamCount[TEAM_TERROR]) && (!(gTeamCount[TEAM_TERROR]++ > gTeamCount[TEAM_SWAT])) && (!(gTeamCount[TEAM_SWAT]++ == gTeamCount[TEAM_TERROR]++)))
{
GameTextForPlayer(playerid,"~r~This team is full~n~Choose another", 2000, 3);
return 0;
}
gTeamCount[TEAM_SWAT]++;
}
case 285:
{
SetPlayerTeam(playerid, TEAM_TERROR);
SetPlayerColor(playerid, TEAM_TERROR_COLOR);
if((gTeamCount[TEAM_TERROR]++ > gTeamCount[TEAM_SWAT]) && (!(gTeamCount[TEAM_SWAT]++ > gTeamCount[TEAM_TERROR])) && (!(gTeamCount[TEAM_TERROR]++ == gTeamCount[TEAM_SWAT]++)))
{
GameTextForPlayer(playerid,"~r~This team is full~n~Choose another", 2000, 3);
return 0;
}
}
}
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
switch(GetPlayerTeam(playerid))
{
case TEAM_SWAT:
{
gTeamCount[TEAM_SWAT] --;
}
case TEAM_TERROR:
{
gTeamCount[TEAM_TERROR] --;
}
}
return 1;
}