12.09.2012, 16:41
hey guys,
yes i already made another topic about this a week ago or something, and there 1 guy helped me but it didnt really worked wut he said...
so well here is the point:
i made a sorta balance system for my server and well, in the code it seems all alright to me, and NO errors/warns at all, but ingame it just doesnt works.... here its ment to do it that when the cops team has like 5 players and the terrorists have 4 or 3 players, then it should say when trying to spawn as a cop it should say its full , join other team... but it doesnt
same in the other way, if i have 3 terrors and 1 cop, a player still can join the terrorists... anyways anyone has got the answer to this? please
ok well this is my pawn code till this far... cant really find the problem though
anyways REP+ for the ones who help me xD
greets niels
yes i already made another topic about this a week ago or something, and there 1 guy helped me but it didnt really worked wut he said...
so well here is the point:
i made a sorta balance system for my server and well, in the code it seems all alright to me, and NO errors/warns at all, but ingame it just doesnt works.... here its ment to do it that when the cops team has like 5 players and the terrorists have 4 or 3 players, then it should say when trying to spawn as a cop it should say its full , join other team... but it doesnt
same in the other way, if i have 3 terrors and 1 cop, a player still can join the terrorists... anyways anyone has got the answer to this? please
pawn Код:
new TeamArmy = 0, TeamTerrorists = 0;
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
if(TeamTerrorists > TeamArmy && (AllTeams[playerid] == TERRORISTS && (AllTeams[playerid] != ARMY)))
{
SendClientMessage(playerid, COLOR_ORANGE, "BALANCE: team Terrorists is full, join team Army");
return 0;
}
else if(TeamTerrorists < TeamArmy && (AllTeams[playerid] == TERRORISTS && (AllTeams[playerid] != ARMY)))
{
TeamTerrorists++;
SendClientMessage(playerid, COLOR_BLUE, "welcome to the Terrorists, use /cmds to see a list of commands");
return 1;
}
else if(TeamArmy > TeamTerrorists && (AllTeams[playerid] == ARMY && (AllTeams[playerid] != TERRORISTS)))
{
SendClientMessage(playerid, COLOR_ORANGE, "BALANCE: Team Terrorists is full, join team Army");
return 0;
}
else if(TeamArmy < TeamTerrorists && (AllTeams[playerid] == ARMY && (AllTeams[playerid] != TERRORISTS)))
{
TeamArmy++;
SendClientMessage(playerid, COLOR_BLUE, "welcome to the Army, use /cmds to see a list of commands");
return 1;
}
return 1;
}
pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
if(AllTeams[playerid] == TERRORISTS && (AllTeams[playerid] != ARMY))
{
TeamTerrorists--;
}
else if(AllTeams[playerid] == ARMY && (AllTeams[playerid] != TERRORISTS))
{
TeamArmy--;
}
return 1;
}
anyways REP+ for the ones who help me xD
greets niels