07.03.2011, 14:58
hi,
i dont know what else i would have to change.
It seems correct ot me.
I also made a command that i can see where the error is.
It seems that after a few joins and disconnects it f**s up somehow.
The team balance just doesnt work. It counts wrong sometimes....
Pls can someone tell me whats wrong?
Pls this is very important i really need ur help here
i dont know what else i would have to change.
It seems correct ot me.
I also made a command that i can see where the error is.
It seems that after a few joins and disconnects it f**s up somehow.
The team balance just doesnt work. It counts wrong sometimes....
Pls can someone tell me whats wrong?
pawn Код:
#define TEAM_POLICE 1
#define TEAM_TERRORISTS 2
#define MAX_TEAMS 2
new firstspawn[MAX_PLAYERS];
new Count_Police;
new Count_Terrorists;
//OnPlayerConnect
firstspawn[playerid] = 0;
//OnPlayerDisconnect
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
Count_Police--;
}
else if(GetPlayerTeam(playerid) == TEAM_TERRORISTS)
{
Count_Terrorists--;
}
//OnPlayerSpawn
if(firstspawn[playerid]==0)
{
if(GetPlayerTeam(playerid) == TEAM_POLICE)
{
Count_Police++;
}
else if(GetPlayerTeam(playerid) == TEAM_TERRORISTS)
{
Count_Terrorists++;
}
}
firstspawn[playerid] = 1;
//OnPlayerRequestSpawn
if((Count_Police > Count_Terrorists) && GetPlayerTeam(playerid) == TEAM_POLICE)
{
SendClientMessage(playerid,0xE100E1FF,"{2B2B2B}Please join the {CC7F32}adverse team {2B2B2B}in order to keep the {CC7F32}teams balanced.");
GameTextForPlayer(playerid, "~b~~h~CTU ~r~team is full!", 800, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}
if((Count_Police < Count_Terrorists) && GetPlayerTeam(playerid) == TEAM_TERRORISTS)
{
SendClientMessage(playerid,0xE100E1FF,"{2B2B2B}Please join the {CC7F32}adverse team {2B2B2B}in order to keep the {CC7F32}teams balanced.");
GameTextForPlayer(playerid, "~r~~h~~h~Coral Snake ~r~team is full!", 800, 5);
PlayerPlaySound(playerid,1055,0, 0, 0);
return 0;
}