1. Any variable created in pawn will be automatically zeroed. No need for "new afk = 0,...etc".
2. What if cl_cmd("kill") is blocked by other plugin ?? use
user_kill(id).
3. What happens when two players of different team used /afk ??
PHP Code:
//Set previous team
cs_set_user_team(id, team);
Where did you store previous team ?? Create an new array szAfkTeams[33] and store their team ids in this array. So when they come back from afk you can assign them to their correct team. Also same goes for afk( new afk[33] ).
4. Remove task at round end.
5.
PHP Code:
get_players ( ctplayers, num,"ae", "CT");
get_players ( tplayers, num2,"ae", "TERRORIST");
Are you trying to balance only alive players ?? if not use "e" instead of "ae".
6. Return PLUGIN_HANDLED in cl cmds.
7.
PHP Code:
if(is_user_alive(id) == 1)
to
PHP Code:
if(is_user_alive(id))
and
to
8. What happenes when /balance is called by an admin in middle of the round. Its better to store a "bool:Balance = 1" when admin calls /balance and run function "
ExecuteTeamBalancer" at round end by checking booleen. Same goes for /afk also.
__________________