From e84653571c8b29f0f868157757e472365f2dd1a1 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 20 Jul 2014 10:27:58 +0200 Subject: [PATCH 1/8] Fix stupid compiler warning on unused wariable. --- plugins/include/amxconst.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc index 9911f084..717c99b5 100755 --- a/plugins/include/amxconst.inc +++ b/plugins/include/amxconst.inc @@ -32,7 +32,7 @@ #define MAX_PLAYERS 33 /* Maximum number of players AMX Mod X supports */ #define MAX_NAME_LENGTH 32 /* Maximum buffer required to store a client name */ -public const MaxClients; /* Maximum number of players the server supports (dynamic) */ +public const MaxClients = 0; /* Maximum number of players the server supports (dynamic) */ #define M_PI 3.1415926535 From 07534edfcda3b65f4b8555800c6e4667f49d4a69 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Sun, 20 Jul 2014 12:27:02 +0200 Subject: [PATCH 2/8] Use the new constants in various place. --- plugins/admin.sma | 14 ++--- plugins/adminchat.sma | 24 ++++----- plugins/admincmd.sma | 52 +++++++++--------- plugins/adminslots.sma | 2 +- plugins/adminvote.sma | 25 ++++----- plugins/antiflood.sma | 4 +- plugins/cmdmenu.sma | 8 +-- plugins/cstrike/miscstats.sma | 38 ++++++------- plugins/cstrike/restmenu.sma | 8 +-- plugins/cstrike/stats_logging.sma | 8 +-- plugins/cstrike/statsx.sma | 17 +++--- plugins/dod/plmenu.sma | 36 ++++++------- plugins/dod/stats.sma | 90 +++++++++++++++---------------- plugins/dod/stats_logging.sma | 6 +-- plugins/include/amxmisc.inc | 31 ++++------- plugins/include/amxmodx.inc | 2 +- plugins/include/xs.inc | 2 +- plugins/mapchooser.sma | 2 +- plugins/mapsmenu.sma | 16 +++--- plugins/menufront.sma | 4 +- plugins/multilingual.sma | 2 +- plugins/ns/idlekicker.sma | 17 +++--- plugins/ns/nscommands.sma | 32 +++++------ plugins/ns/plmenu.sma | 42 +++++++-------- plugins/ns/unstuck.sma | 2 +- plugins/pausecfg.sma | 2 +- plugins/plmenu.sma | 46 ++++++++-------- plugins/pluginmenu.sma | 19 ++++--- plugins/statscfg.sma | 2 +- plugins/telemenu.sma | 8 +-- plugins/tfc/plmenu.sma | 36 ++++++------- plugins/tfc/stats.sma | 58 ++++++++++---------- plugins/tfc/stats_logging.sma | 6 +-- plugins/timeleft.sma | 2 +- plugins/ts/stats.sma | 48 ++++++++--------- plugins/ts/stats_logging.sma | 6 +-- 36 files changed, 341 insertions(+), 376 deletions(-) diff --git a/plugins/admin.sma b/plugins/admin.sma index fbd19cac..19980456 100755 --- a/plugins/admin.sma +++ b/plugins/admin.sma @@ -53,7 +53,7 @@ new PLUGINNAME[] = "AMX Mod X" #define ADMIN_IPADDR (1<<3) #define ADMIN_NAME (1<<4) -new bool:g_CaseSensitiveName[33]; +new bool:g_CaseSensitiveName[MAX_PLAYERS]; // pcvars new amx_mode; @@ -165,7 +165,7 @@ public addadminfn(id, level, cid) player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS) } else { new _steamid[44] - static _players[32], _num, _pv + static _players[MAX_PLAYERS], _num, _pv get_players(_players, _num) for (new _i=0; _i<_num; _i++) { @@ -236,7 +236,7 @@ public addadminfn(id, level, cid) read_argv(3, password, 63) new auth[33] - new Comment[33]; // name of player to pass to comment field + new Comment[MAX_NAME_LENGTH]; // name of player to pass to comment field if (idtype & ADMIN_LOOKUP) { get_user_name(player, Comment, sizeof(Comment)-1) @@ -273,7 +273,7 @@ public addadminfn(id, level, cid) if (player > 0) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_info(player, "name", name, 31) accessUser(player, name) } @@ -602,8 +602,8 @@ public cmdReload(id, level, cid) } #endif - new players[32], num, pv - new name[32] + new players[MAX_PLAYERS], num, pv + new name[MAX_NAME_LENGTH] get_players(players, num) for (new i=0; i<%s><>^" set xvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg1, arg2); // Display the message to all clients - new players[32], pnum, plr; + new players[MAX_PLAYERS], pnum, plr; get_players(players, pnum, "ch"); for (new i; i<%s><>^" cancel vote session", name, get_user_userid(id), authid) - - new maxpl=get_maxplayers(); new msg[256]; - for (new i = 1; i <= maxpl; i++) + for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { @@ -152,7 +150,7 @@ public checkVotes() new votesNum = g_voteCount[0] + g_voteCount[1] + g_voteCount[2] + g_voteCount[3] new iRatio = votesNum ? floatround(g_voteRatio * float(votesNum), floatround_ceil) : 1 new iResult = g_voteCount[best] - new players[32], pnum, i + new players[MAX_PLAYERS], pnum, i get_players(players, pnum, "c") @@ -218,7 +216,7 @@ public voteCount(id, key) { if (get_cvar_num("amx_vote_answers")) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(id, name, 31) if (g_yesNoVote) @@ -304,7 +302,7 @@ public cmdVoteMap(id, level, cid) g_yesNoVote = 1 } - new authid[32], name[32] + new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, 31) get_user_name(id, name, 31) @@ -314,9 +312,8 @@ public cmdVoteMap(id, level, cid) else log_amx("Vote: ^"%s<%d><%s><>^" vote maps (map#1 ^"%s^") (map#2 ^"%s^") (map#3 ^"%s^") (map#4 ^"%s^")", name, get_user_userid(id), authid, g_optionName[0], g_optionName[1], g_optionName[2], g_optionName[3]) - new maxpl=get_maxplayers(); new msg[256]; - for (new i = 1; i <= maxpl; i++) + for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { @@ -378,15 +375,14 @@ public cmdVote(id, level, cid) read_argv(i+2, g_optionName[i], sizeof(g_optionName[])-1); } - new authid[32], name[32] + new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, 31) get_user_name(id, name, 31) log_amx("Vote: ^"%s<%d><%s><>^" vote custom (question ^"%s^") (option#1 ^"%s^") (option#2 ^"%s^")", name, get_user_userid(id), authid, quest, g_optionName[0], g_optionName[1]) - new maxpl=get_maxplayers(); new msg[256]; - for (new i = 1; i <= maxpl; i++) + for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { @@ -513,17 +509,16 @@ public cmdVoteKickBan(id, level, cid) num_to_str(get_user_userid(player), g_optionName[0], 31) } - new authid[32], name[32] + new authid[32], name[MAX_NAME_LENGTH] get_user_authid(id, authid, 31) get_user_name(id, name, 31) log_amx("Vote: ^"%s<%d><%s><>^" vote %s (target ^"%s^")", name, get_user_userid(id), authid, voteban ? "ban" : "kick", arg) - new maxpl=get_maxplayers(); new msg[256]; new right[256]; new dummy[1]; - for (new i = 1; i <= maxpl; i++) + for (new i = 1; i <= MaxClients; i++) { if (is_user_connected(i) && !is_user_bot(i)) { diff --git a/plugins/antiflood.sma b/plugins/antiflood.sma index a96e30da..6d454fc0 100755 --- a/plugins/antiflood.sma +++ b/plugins/antiflood.sma @@ -34,8 +34,8 @@ #include -new Float:g_Flooding[33] = {0.0, ...} -new g_Flood[33] = {0, ...} +new Float:g_Flooding[MAX_PLAYERS] = {0.0, ...} +new g_Flood[MAX_PLAYERS] = {0, ...} new amx_flood_time; diff --git a/plugins/cmdmenu.sma b/plugins/cmdmenu.sma index f9de98a9..6e22803c 100755 --- a/plugins/cmdmenu.sma +++ b/plugins/cmdmenu.sma @@ -86,10 +86,10 @@ new g_cvarCmd[MAX_CVARS*5][32] new g_cvarCmdNum new g_cvarNum -new g_menuPosition[33] -new g_menuSelect[33][MAX_CMDS] -new g_menuSelectNum[33] -new g_menuLayer[33] +new g_menuPosition[MAX_PLAYERS] +new g_menuSelect[MAX_PLAYERS][MAX_CMDS] +new g_menuSelectNum[MAX_PLAYERS] +new g_menuLayer[MAX_PLAYERS] new g_coloredMenus diff --git a/plugins/cstrike/miscstats.sma b/plugins/cstrike/miscstats.sma index 4927a48e..06df097f 100755 --- a/plugins/cstrike/miscstats.sma +++ b/plugins/cstrike/miscstats.sma @@ -77,8 +77,8 @@ public GrenadeSuicideSound const SOUNDFILE_PATH_MAXLEN = 64 const SOUND_SHORTPATH_MAXLEN = SOUNDFILE_PATH_MAXLEN - 10 // 64 (sound/ [ 54 ] .wav) critical value for fast dl -new g_streakKills[33][2] -new g_multiKills[33][2] +new g_streakKills[MAX_PLAYERS][2] +new g_multiKills[MAX_PLAYERS][2] new g_C4Timer new g_Defusing new g_Planter @@ -87,7 +87,7 @@ new g_LastAnnounce new g_roundCount new Float:g_doubleKill new g_doubleKillId -new g_friend[33] +new g_friend[MAX_PLAYERS] new g_firstBlood new g_center1_sync new g_announce_sync @@ -104,8 +104,8 @@ const TASK_DELAYED_NEW_ROUND = 98038 const TEAM_T = 1 const TEAM_CT = 2 -new g_connected[33] -new g_msounds[33] +new g_connected[MAX_PLAYERS] +new g_msounds[MAX_PLAYERS] new const _msound[] = "_msound" new g_MultiKillMsg[7][] = @@ -527,7 +527,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) if ((a > -1) && !(a % 2)) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(killer, name, charsmax(name)) if ((a >>= 1) > 6) @@ -567,7 +567,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if( TEAM_T <= team <= TEAM_CT ) { - new ppl[32], pplnum, epplnum, a + new ppl[MAX_PLAYERS], pplnum, epplnum, a get_players(ppl, epplnum, "ae", team == TEAM_T ? "CT" : "TERRORIST") get_players(ppl, pplnum, "ae", team == TEAM_T ? "TERRORIST" : "CT") if( victim_alive ) @@ -611,7 +611,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) if (LastMan || LastManSound) { - new cts[32], ts[32], ctsnum, tsnum, b + new cts[MAX_PLAYERS], ts[MAX_PLAYERS], ctsnum, tsnum, b get_players(cts, ctsnum, "ae", "CT") get_players(ts, tsnum, "ae", "TERRORIST") @@ -648,7 +648,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if( LastMan ) { - new ctname[32], tname[32] + new ctname[MAX_NAME_LENGTH], tname[MAX_NAME_LENGTH] get_user_name(cts[0], ctname, charsmax(ctname)) get_user_name(ts[0], tname, charsmax(tname)) @@ -681,7 +681,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if( LastMan ) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(g_LastAnnounce, name, charsmax(name)) @@ -700,7 +700,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if (KnifeKill) { - new killer_name[32], victim_name[32] + new killer_name[MAX_NAME_LENGTH], victim_name[MAX_NAME_LENGTH] get_user_name(killer, killer_name, charsmax(killer_name)) get_user_name(victim, victim_name, charsmax(victim_name)) @@ -715,7 +715,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) if (wpnindex == CSW_HEGRENADE) { - new killer_name[32], victim_name[32] + new killer_name[MAX_NAME_LENGTH], victim_name[MAX_NAME_LENGTH] if( GrenadeKill || GrenadeSuicide ) { get_user_name(killer, killer_name, charsmax(killer_name)) @@ -744,7 +744,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if (HeadShotKill && wpnindex) { - new killer_name[32], victim_name[32], weapon_name[32], message[256], players[32], pnum, plr + new killer_name[MAX_NAME_LENGTH], victim_name[MAX_NAME_LENGTH], weapon_name[32], message[256], players[MAX_PLAYERS], pnum, plr xmod_get_wpnname(wpnindex, weapon_name, charsmax(weapon_name)) get_user_name(killer, killer_name, charsmax(killer_name)) @@ -781,7 +781,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK) { if (DoubleKill) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(killer, name, charsmax(name)) @@ -813,7 +813,7 @@ public showStatus(id) { if( PlayerName) { - new name[32], pid = read_data(2) + new name[MAX_NAME_LENGTH], pid = read_data(2) get_user_name(pid, name, charsmax(name)) new color1 = 0, color2 = 0 @@ -866,7 +866,7 @@ public LogEvent_Round_Start() { if (KillingStreak) { - new appl[32], ppl, i + new appl[MAX_PLAYERS], ppl, i get_players(appl, ppl, "ac") for (new a = 0; a < ppl; ++a) @@ -914,7 +914,7 @@ public checkKills(param[]) if (MultiKill) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(id, name, charsmax(name)) set_hudmessage(255, 0, 100, 0.05, 0.50, 2, 0.02, 6.0, 0.01, 0.1, -1) @@ -945,7 +945,7 @@ public radioKill() announceEvent(id, message[]) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(id, name, charsmax(name)) set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, -1) @@ -1088,7 +1088,7 @@ play_sound(id, sound[]) } else { - new players[32], pnum, id + new players[MAX_PLAYERS], pnum, id get_players(players, pnum, "ch") for(--pnum; pnum>=0; pnum--) diff --git a/plugins/cstrike/restmenu.sma b/plugins/cstrike/restmenu.sma index 143bd68f..e1197f13 100755 --- a/plugins/cstrike/restmenu.sma +++ b/plugins/cstrike/restmenu.sma @@ -40,14 +40,14 @@ #define MAXMENUPOS 34 -new g_Position[33] +new g_Position[MAX_PLAYERS] new g_Modified new g_blockPos[112] new g_saveFile[64] new g_Restricted[] = "* This item is restricted *" new g_szWeapRestr[27] = "00000000000000000000000000" new g_szEquipAmmoRestr[10] = "000000000" -new g_InBuyMenu[33] +new g_InBuyMenu[MAX_PLAYERS] new g_RegisteredMenus[10] new g_menuStrings[6][] = @@ -304,8 +304,8 @@ new g_Aliases2[MAXMENUPOS][] = } #define AUTOBUYLENGTH 511 -new g_Autobuy[33][AUTOBUYLENGTH + 1] -//new g_Rebuy[33][AUTOBUYLENGTH + 1] +new g_Autobuy[MAX_PLAYERS][AUTOBUYLENGTH + 1] +//new g_Rebuy[MAX_PLAYERS][AUTOBUYLENGTH + 1] bool:IsOurMenuID(id) { diff --git a/plugins/cstrike/stats_logging.sma b/plugins/cstrike/stats_logging.sma index 992396d2..54f241d6 100755 --- a/plugins/cstrike/stats_logging.sma +++ b/plugins/cstrike/stats_logging.sma @@ -35,9 +35,9 @@ #include #include -new g_pingSum[33] -new g_pingCount[33] -new g_inGame[33] +new g_pingSum[MAX_PLAYERS] +new g_pingCount[MAX_PLAYERS] +new g_inGame[MAX_PLAYERS] public plugin_init() { @@ -58,7 +58,7 @@ public client_disconnect(id) remove_task(id) - new szTeam[16], szName[32], szAuthid[32], iStats[8], iHits[8], szWeapon[24] + new szTeam[16], szName[MAX_NAME_LENGTH], szAuthid[32], iStats[8], iHits[8], szWeapon[24] new iUserid = get_user_userid(id) new _max = xmod_get_maxweapons() diff --git a/plugins/cstrike/statsx.sma b/plugins/cstrike/statsx.sma index 68a85de3..642d4ab9 100755 --- a/plugins/cstrike/statsx.sma +++ b/plugins/cstrike/statsx.sma @@ -1,4 +1,4 @@ -/* AMX Mod X + /* AMX Mod X * StatsX Plugin * * by the AMX Mod X Development Team @@ -95,9 +95,6 @@ public SpecRankInfo = 0 // displays rank info when spectating // Standard Contstants. #define MAX_TEAMS 2 -#define MAX_PLAYERS 32 + 1 - -#define MAX_NAME_LENGTH 31 #define MAX_WEAPON_LENGTH 31 #define MAX_TEXT_LENGTH 255 #define MAX_BUFFER_LENGTH 2047 @@ -141,7 +138,7 @@ new g_iPluginMode = 0 new g_izUserMenuPosition[MAX_PLAYERS] = {0, ...} new g_izUserMenuAction[MAX_PLAYERS] = {0, ...} -new g_izUserMenuPlayers[MAX_PLAYERS][32] +new g_izUserMenuPlayers[MAX_PLAYERS][MAX_PLAYERS] new g_izSpecMode[MAX_PLAYERS] = {0, ...} @@ -371,7 +368,6 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1]) new izStats[8], izBody[8] new iAttacker new iFound, iLen - new iMaxPlayer = get_maxplayers() iFound = 0 sBuffer[0] = 0 @@ -394,7 +390,7 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1]) iLen = formatex(sBuffer, charsmax(sBuffer), "%L:^n", id, "ATTACKERS") // Get and format attacker list. - for (iAttacker = 1; iAttacker <= iMaxPlayer; iAttacker++) + for (iAttacker = 1; iAttacker <= MaxClients; iAttacker++) { if (get_user_astats(id, iAttacker, izStats, izBody, t_sWpn, charsmax(t_sWpn))) { @@ -430,7 +426,6 @@ get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1]) new izStats[8], izBody[8] new iVictim new iFound, iLen - new iMaxPlayer = get_maxplayers() iFound = 0 sBuffer[0] = 0 @@ -446,7 +441,7 @@ get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1]) else iLen = formatex(sBuffer, charsmax(sBuffer), "%L:^n", id, "VICTIMS") - for (iVictim = 1; iVictim <= iMaxPlayer; iVictim++) + for (iVictim = 1; iVictim <= MaxClients; iVictim++) { if (get_user_vstats(id, iVictim, izStats, izBody, t_sWpn, charsmax(t_sWpn))) { @@ -1585,7 +1580,7 @@ endround_stats() if (g_iRoundEndProcessed || !g_iRoundEndTriggered) return - new iaPlayers[32], iPlayer, iPlayers, id + new iaPlayers[MAX_PLAYERS], iPlayer, iPlayers, id get_players(iaPlayers, iPlayers) @@ -1637,7 +1632,7 @@ public eventIntermission() public end_game_stats() { - new iaPlayers[32], iPlayer, iPlayers, id + new iaPlayers[MAX_PLAYERS], iPlayer, iPlayers, id if (EndPlayer) { diff --git a/plugins/dod/plmenu.sma b/plugins/dod/plmenu.sma index 87493d24..d6af623e 100755 --- a/plugins/dod/plmenu.sma +++ b/plugins/dod/plmenu.sma @@ -36,14 +36,14 @@ #include #include -new g_menuPosition[33] -new g_menuPlayers[33][32] -new g_menuPlayersNum[33] -new g_menuOption[33] -new g_menuSettings[33] +new g_menuPosition[MAX_PLAYERS] +new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS] +new g_menuPlayersNum[MAX_PLAYERS] +new g_menuOption[MAX_PLAYERS] +new g_menuSettings[MAX_PLAYERS] -new g_menuSelect[33][64] -new g_menuSelectNum[33] +new g_menuSelect[MAX_PLAYERS][64] +new g_menuSelectNum[MAX_PLAYERS] #define MAX_CLCMDS 24 @@ -137,7 +137,7 @@ public actionBanMenu(id, key) new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] - new name[32], name2[32], authid[32], authid2[32] + new name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH], authid[32], authid2[32] get_user_name(player, name2, 31) get_user_authid(id, authid, 31) get_user_authid(player, authid2, 31) @@ -214,7 +214,7 @@ displayBanMenu(id,pos) new menuBody[512] new b = 0 new i - new name[32] + new name[MAX_NAME_LENGTH] new start = pos * 7 if (start >= g_menuPlayersNum[id]) @@ -298,7 +298,7 @@ public actionSlapMenu(id,key) { default: { new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] - new name2[32] + new name2[MAX_NAME_LENGTH] get_user_name(player,name2,31) if (!is_user_alive(player)) { @@ -307,7 +307,7 @@ public actionSlapMenu(id,key) { return PLUGIN_HANDLED } - new authid[32],authid2[32], name[32] + new authid[32],authid2[32], name[MAX_NAME_LENGTH] get_user_authid(id,authid,31) get_user_authid(player,authid2,31) @@ -352,7 +352,7 @@ displaySlapMenu(id,pos) new menuBody[512] new b = 0 new i - new name[32], team[8] + new name[MAX_NAME_LENGTH], team[8] new start = pos * 7 if (start >= g_menuPlayersNum[id]) @@ -427,7 +427,7 @@ public actionKickMenu(id,key) default: { new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key] - new authid[32],authid2[32], name[32], name2[32] + new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH] get_user_authid(id,authid,31) get_user_authid(player,authid2,31) get_user_name(id,name,31) @@ -461,7 +461,7 @@ displayKickMenu(id, pos) new menuBody[512] new b = 0 new i - new name[32] + new name[MAX_NAME_LENGTH] new start = pos * 8 if (start >= g_menuPlayersNum[id]) @@ -529,7 +529,7 @@ public actionTeamMenu(id,key) { case 9: displayTeamMenu(id,--g_menuPosition[id]) default: { new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] - new authid[32],authid2[32], name[32], name2[32] + new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH] get_user_name(player,name2,31) get_user_authid(id,authid,31) get_user_authid(player,authid2,31) @@ -562,7 +562,7 @@ displayTeamMenu(id, pos) new menuBody[512] new b = 0 new i, iteam - new name[32], team[8] + new name[MAX_NAME_LENGTH], team[8] new start = pos * 7 if (start >= g_menuPlayersNum[id]) @@ -640,7 +640,7 @@ public actionClcmdMenu(id,key) { new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1] if (is_user_connected(player)) { - new command[64], authid[32], name[32], userid[32] + new command[64], authid[32], name[MAX_NAME_LENGTH], userid[32] copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]]) get_user_authid(player,authid,31) get_user_name(player,name,31) @@ -673,7 +673,7 @@ displayClcmdMenu(id, pos) new menuBody[512] new b = 0 new i - new name[32] + new name[MAX_NAME_LENGTH] new start = pos * 7 if (start >= g_menuPlayersNum[id]) diff --git a/plugins/dod/stats.sma b/plugins/dod/stats.sma index 63f33a66..e87270ad 100755 --- a/plugins/dod/stats.sma +++ b/plugins/dod/stats.sma @@ -58,20 +58,20 @@ public EnemyGreKillSound public LeadSounds public MortarKill -new g_streakKills[33][2] -new g_multiKills[33][2] +new g_streakKills[MAX_PLAYERS][2] +new g_multiKills[MAX_PLAYERS][2] new Float:g_prevKill new g_prevKillerId new g_KillCount; new g_RoundScore[2] -new g_userPosition[33] -new g_userState[33] -new g_userPlayers[33][32] +new g_userPosition[MAX_PLAYERS] +new g_userState[MAX_PLAYERS] +new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS] new g_Buffer[2048] -new g_Killers[33][3] -new Float:g_DeathStats[33] +new g_Killers[MAX_PLAYERS][3] +new Float:g_DeathStats[MAX_PLAYERS] new g_damage_sync new g_center1_sync @@ -251,14 +251,14 @@ public cmdFF(id){ public endGameStats(){ new i if ( EndPlayer ){ - new players[32], inum + new players[MAX_PLAYERS], inum get_players(players,inum) for(i = 0; i < inum; ++i){ displayStats_steam(players[i],players[i]) } } else if ( EndTop15 ){ - new players[32], inum + new players[MAX_PLAYERS], inum get_players(players,inum) new g_Top[8], top = get_cvar_num("dodstats_topvalue") @@ -286,10 +286,9 @@ public cmdStats(id){ /* build list of attackers */ getAttackers(id) { - new name[32],wpn[32], stats[9],body[8],found=0 + new name[MAX_NAME_LENGTH],wpn[32], stats[9],body[8],found=0 new pos = format(g_Buffer,2047,"%L^n",id,"ATTACKERS") - new amax = get_maxplayers() - for(new a = 1; a <= amax; ++a){ + for(new a = 1; a <= MaxClients; ++a){ if(get_user_astats(id,a,stats,body,wpn,31)) { @@ -308,10 +307,9 @@ getAttackers(id) { /* build list of victims */ getVictims(id) { - new name[32],wpn[32], stats[9],body[8],found=0 + new name[MAX_NAME_LENGTH],wpn[32], stats[9],body[8],found=0 new pos = format(g_Buffer,2047,"%L^n",id,"VICTIMS") - new amax = get_maxplayers() - for(new a = 1; a <= amax; ++a){ + for(new a = 1; a <= MaxClients; ++a){ if(get_user_vstats(id,a,stats,body,wpn,31)) { found = 1 @@ -338,7 +336,7 @@ getHits(id,killer) { /* build list of hits for say hp */ getMyHits(id,killed) { - new name[32], stats[9], body[8], found = 0 + new name[MAX_NAME_LENGTH], stats[9], body[8], found = 0 get_user_name(killed,name,31) new pos = format(g_Buffer,2047,"%L",id,"YOU_HIT",name) get_user_vstats(id,killed,stats,body) @@ -361,7 +359,7 @@ public cmdKiller(id) { return PLUGIN_HANDLED } if (g_Killers[id][0]) { - new name[32], stats[9], body[8], wpn[33], mstats[9], mbody[8] + new name[MAX_NAME_LENGTH], stats[9], body[8], wpn[33], mstats[9], mbody[8] get_user_name(g_Killers[id][0],name,31) get_user_astats(id,g_Killers[id][0],stats,body,wpn,31) get_user_vstats(id,g_Killers[id][0],mstats,mbody) @@ -410,7 +408,7 @@ showStatsMenu(id,pos){ if (start >= inum) start = pos = g_userPosition[id] = 0 new len = format(menu_body,511,"\y%L\R%d/%d^n\w^n",id,"SERVER_STATS",pos + 1,((inum/max_menupos)+((inum%max_menupos)?1:0))) - new name[32], end = start + max_menupos, keys = (1<<9)|(1<<7) + new name[MAX_NAME_LENGTH], end = start + max_menupos, keys = (1<<9)|(1<<7) if (end > inum) end = inum for(new a = start; a < end; ++a){ get_user_name(g_userPlayers[id][a],name,31) @@ -439,10 +437,10 @@ public NadeCatch(id){ new catch = ( ( get_user_team(id) == 1 && GreId == 15 ) || ( get_user_team(id) == 2 && GreId == 16 ) ) ? 1:0 if ( catch ) { if ( GreCatch ){ - new player_name[32] - get_user_name(id,player_name,32) + new player_name[MAX_NAME_LENGTH] + get_user_name(id,player_name,charsmax(player_name)) set_hudmessage(200, 100, 0, -1.0, 0.20, 0, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue show_hudmessage(i,"%L",i,"NADE_CAUGHT",player_name) @@ -473,12 +471,12 @@ public round_end(){ if ( !EndRoundStats ) return PLUGIN_CONTINUE - new g_Buffer2[1024], len, players[32], pnum, stats[9],bodyhits[8] + new g_Buffer2[1024], len, players[MAX_PLAYERS], pnum, stats[9],bodyhits[8] get_players( players , pnum ) new score = 0, kills = 0, hs =0 , damage = 0, hits = 0, who1 = 0, who2 = 0, who3 = 0 - new name1[32],name2[32],name3[32] + new name1[MAX_NAME_LENGTH],name2[MAX_NAME_LENGTH],name3[MAX_NAME_LENGTH] for(new i = 0; i < pnum; ++i){ get_user_rstats( players[i],stats, bodyhits ) @@ -541,7 +539,7 @@ public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) { if ( TA ){ if ( TAInfo && is_user_alive(victim) ){ - new attacker_name[32] + new attacker_name[MAX_NAME_LENGTH] get_user_name(attacker,attacker_name,31) client_print(0,print_chat,"%L",LANG_PLAYER,"TA_MSG",attacker_name) } @@ -563,7 +561,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) if (!is_user_connected(killer) || !is_user_connected(victim)) return PLUGIN_CONTINUE - new killer_name[32] + new killer_name[MAX_NAME_LENGTH] get_user_name(killer,killer_name,31) new enemygre = ( ( (wpnindex == DODW_HANDGRENADE || wpnindex == DODW_MILLS_BOMB) && get_user_team(killer) == 2 ) || ( wpnindex == DODW_STICKGRENADE && get_user_team(killer) == 1 ) ) ? 1:0 @@ -585,7 +583,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) new headshot = ( hitplace == HIT_HEAD ) ? 1:0 new selfKill = ( killer == victim ) ? 1:0 - new victim_name[32] + new victim_name[MAX_NAME_LENGTH] get_user_name(victim,victim_name,31) new Float:statstime = get_cvar_float("dodstats_statstime") @@ -603,7 +601,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) if ( !enemygre ) ShowSyncHudMsg(0, g_center1_sync,"%L",LANG_PLAYER,g_SHeMessages[ random_num(0,3) ],victim_name) else - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_center1_sync, "%L",i,"NADE_FAILED",victim_name) @@ -654,7 +652,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) if ( (a >>= 1) > 6 ) a = 6 if ( KillingStreak ){ set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[ a ], killer_name) @@ -680,7 +678,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue @@ -693,7 +691,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) if ( enemygre ){ if ( EnemyGreKill ){ set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_center1_sync, "%L",LANG_PLAYER,"NADE_MASTER",killer_name) @@ -703,7 +701,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) } else if ( GrenadeKill ){ set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_center1_sync, "%L",i,g_HeMessages[ random_num(0,3)],killer_name,victim_name) @@ -713,7 +711,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) if ( headshot && (HeadShotKill || HeadShotKillSound) && !xmod_is_melee_wpn(wpnindex) ){ if ( HeadShotKill ){ - new weapon[32], message[256], players[32], pnum + new weapon[32], message[256], players[MAX_PLAYERS], pnum xmod_get_wpnname(wpnindex,weapon,31) get_players(players,pnum,"c") @@ -733,7 +731,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK) if ( wpnindex == DODW_MORTAR && MortarKill ){ set_hudmessage(100, 100, 255, -1.0, 0.19, 0, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_center2_sync, "%L",i,mortarmsg[random_num(0,1)],killer_name,victim_name) @@ -763,14 +761,14 @@ public showDoubleKill(){ new pos = g_KillCount - 2 if ( pos > 2 ) pos = 2 if ( DoubleKill ) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(g_prevKillerId,name,31) if ( pos == 2 ){ new kills[3] num_to_str(g_KillCount,kills,2) } set_hudmessage(65, 102, 158, -1.0, 0.25, 0, 6.0, 6.0, 0.5, 0.15, -1) - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue show_hudmessage(i,"%L",i,g_DoubleKillMsg[pos],name,g_KillCount) @@ -788,11 +786,11 @@ public checkKills(param[]){ a -= 3 if ( a > -1 ){ if ( MultiKill ) { - new name[32] + new name[MAX_NAME_LENGTH] get_user_name(id,name,31) set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, -1) if ( a > 6 ) a = 6 - for (new i=1;i<=get_maxplayers();i++){ + for (new i=1;i<=MaxClients;i++){ if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() ) continue ShowSyncHudMsg(i, g_left_sync, "%L",i,g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1]) @@ -811,7 +809,7 @@ public checkKills(param[]){ new LeaderScore new NumOfLeaders new LeaderID -new PScore[33] +new PScore[MAX_PLAYERS] public client_disconnect(id) { if ( !LeadSounds || isDSMActive() ) return PLUGIN_CONTINUE @@ -820,7 +818,7 @@ public client_disconnect(id) { PScore[id] = 0 if ( NumOfLeaders == 0 ){ LeaderScore = 0 - for ( new i=1; i<33; i++ ) + for ( new i=1; i LeaderScore ){ @@ -836,7 +834,7 @@ public client_disconnect(id) { else if ( NumOfLeaders == 1 ) client_cmd( LeaderID,"spk misc/takenlead" ) else if ( NumOfLeaders > 1 ) - for ( new i=1; i<33; i++ ) + for ( new i=1; i 1 ){ - for ( new i=1; i<33; i++ ) + for ( new i=1; i
")
@@ -952,7 +950,7 @@ public cmdRank(id){
 }
 
 displayRank_steam(id,dest) {
- new name[32], stats[9], body[8]
+ new name[MAX_NAME_LENGTH], stats[9], body[8]
  new rank_pos = get_user_stats(id,stats,body)
 
  new pos = copy(g_Buffer,2047,"
")
@@ -991,7 +989,7 @@ public cmdTop15(id) {
 
 /* get top 15 */
 getTop15_steam(id){
-  new stats[9], body[8], name[32]
+  new stats[9], body[8], name[MAX_NAME_LENGTH]
 
   new pos = copy(g_Buffer,2047,"
")
 
diff --git a/plugins/dod/stats_logging.sma b/plugins/dod/stats_logging.sma
index b05a1582..589dd37a 100755
--- a/plugins/dod/stats_logging.sma
+++ b/plugins/dod/stats_logging.sma
@@ -8,8 +8,8 @@
 #include 
 #include 
 
-new g_pingSum[33]
-new g_pingCount[33]
+new g_pingSum[MAX_PLAYERS]
+new g_pingCount[MAX_PLAYERS]
 
 public plugin_init()
   register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@@ -17,7 +17,7 @@ public plugin_init()
 public client_disconnect(id) {
   if ( is_user_bot( id ) || !is_user_connected(id) || !isDSMActive() ) return PLUGIN_CONTINUE
   remove_task( id )
-  new szTeam[16],szName[32],szAuthid[32], iStats[9], iHits[8], szWeapon[16]
+  new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[9], iHits[8], szWeapon[16]
   new iUserid = get_user_userid( id )
   get_user_info(id,"team", szTeam, 15 )
   szTeam[0] -= 32;
diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc
index cae3cf67..c2b7f712 100755
--- a/plugins/include/amxmisc.inc
+++ b/plugins/include/amxmisc.inc
@@ -111,7 +111,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
 		if ((get_user_flags(player) & ADMIN_IMMUNITY) && 
 			((flags & CMDTARGET_ALLOW_SELF) ? (id != player) : true) ) 
 		{
-			new imname[32];
+			new imname[MAX_NAME_LENGTH];
 			get_user_name(player,imname,31);
 			console_print(id,"%L",id,"CLIENT_IMM",imname);
 			return 0;
@@ -121,7 +121,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
 	{
 		if (!is_user_alive(player)) 
 		{
-			new imname[32];
+			new imname[MAX_NAME_LENGTH];
 			get_user_name(player,imname,31);
 			console_print(id,"%L",id,"CANT_PERF_DEAD",imname);
 			return 0;
@@ -131,7 +131,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
 	{
 		if (is_user_bot(player)) 
 		{
-			new imname[32];
+			new imname[MAX_NAME_LENGTH];
 			get_user_name(player,imname,31);
 			console_print(id,"%L",id,"CANT_PERF_BOT",imname);
 			return 0;
@@ -178,10 +178,7 @@ stock show_activity( id, const name[], const fmt[], any:... )
 	{
 		case 5: // hide name only to admins, show nothing to normal users
 		{
-			new __maxclients=get_maxplayers();
-			
-			
-			for (new i=1; i<=__maxclients; i++)
+			for (new i=1; i<=MaxClients; i++)
 			{
 				if (is_user_connected(i))
 				{
@@ -194,9 +191,7 @@ stock show_activity( id, const name[], const fmt[], any:... )
 		}
 		case 4: // show name only to admins, show nothing to normal users
 		{
-			new __maxclients=get_maxplayers();
-			
-			for (new i=1; i<=__maxclients; i++)
+			for (new i=1; i<=MaxClients; i++)
 			{
 				if (is_user_connected(i))
 				{
@@ -209,9 +204,7 @@ stock show_activity( id, const name[], const fmt[], any:... )
 		}
 		case 3: // show name only to admins, hide name from normal users
 		{
-			new __maxclients=get_maxplayers();
-			
-			for (new i=1; i<=__maxclients; i++)
+			for (new i=1; i<=MaxClients; i++)
 			{
 				if (is_user_connected(i))
 				{
@@ -350,12 +343,10 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
 	new keyfmt[256];
 	new i;
 	
-	new __maxclients=get_maxplayers();
-	
 	switch( get_pcvar_num(__amx_show_activity) )
 	{
 	case 5: // hide name to admins, display nothing to normal players
-		while (i++ < __maxclients)
+		while (i++ < MaxClients)
 		{
 			if ( is_user_connected(i) )
 			{
@@ -370,7 +361,7 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
 			}
 		}
 	case 4: // show name only to admins, display nothing to normal players
-		while (i++ < __maxclients)
+		while (i++ < MaxClients)
 		{
 			if ( is_user_connected(i) )
 			{
@@ -383,7 +374,7 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
 			}
 		}
 	case 3: // show name only to admins, hide name from normal users
-		while (i++ < __maxclients)
+		while (i++ < MaxClients)
 		{
 			if ( is_user_connected(i) )
 			{
@@ -403,7 +394,7 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
 			}
 		}
 	case 2: // show name to all users
-		while (i++ < __maxclients)
+		while (i++ < MaxClients)
 		{
 			if ( is_user_connected(i) )
 			{
@@ -413,7 +404,7 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
 			}
 		}
 	case 1: // hide name from all users
-		while (i++ < __maxclients)
+		while (i++ < MaxClients)
 		{
 			if ( is_user_connected(i) )
 			{
diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc
index 729b4c4e..0ecd8cc8 100755
--- a/plugins/include/amxmodx.inc
+++ b/plugins/include/amxmodx.inc
@@ -405,7 +405,7 @@ native get_playersnum(flag=0);
 * "g" - ignore case sensitivity.
 * "h" - skip HLTV.
 * Example: Get all alive CTs: get_players(players,num,"ae","CT") */
-native get_players(players[32], &num ,const flags[]="", const team[]="");
+native get_players(players[MAX_PLAYERS], &num ,const flags[]="", const team[]="");
 
 /* Gets argument from command. */
 native read_argv(id,output[],len);
diff --git a/plugins/include/xs.inc b/plugins/include/xs.inc
index fe9d77a8..e7f3c6fb 100755
--- a/plugins/include/xs.inc
+++ b/plugins/include/xs.inc
@@ -884,7 +884,7 @@
 	{	
 		new maxplayers = get_cvar_num("sv_visiblemaxplayers");
 		if (maxplayers <= 0)
-			maxplayers = get_maxplayers();
+			maxplayers = MaxClients;
 		
 		return (get_playersnum(1) <= maxplayers-num) ? true : false;
 	}
diff --git a/plugins/mapchooser.sma b/plugins/mapchooser.sma
index 0e0d0e90..a84acb15 100755
--- a/plugins/mapchooser.sma
+++ b/plugins/mapchooser.sma
@@ -125,7 +125,7 @@ public countVote(id, key)
 {
 	if (get_cvar_float("amx_vote_answers"))
 	{
-		new name[32]
+		new name[MAX_NAME_LENGTH]
 		get_user_name(id, name, 31)
 		
 		if (key == SELECTMAPS)
diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma
index b957f302..dbc508bf 100755
--- a/plugins/mapsmenu.sma
+++ b/plugins/mapsmenu.sma
@@ -37,12 +37,12 @@
 
 new Array:g_mapName;
 new g_mapNums
-new g_menuPosition[33]
+new g_menuPosition[MAX_PLAYERS]
 
 new g_voteCount[5]
 
-new g_voteSelected[33][4]
-new g_voteSelectedNum[33]
+new g_voteSelected[MAX_PLAYERS][4]
+new g_voteSelectedNum[MAX_PLAYERS]
 
 new g_coloredMenus
 
@@ -118,7 +118,7 @@ public actionResult(id, key)
 public checkVotes(id)
 {
 	id -= 34567
-	new num, ppl[32], a = 0
+	new num, ppl[MAX_PLAYERS], a = 0
 	
 	get_players(ppl, num, "c")
 	if (num == 0) num = 1
@@ -190,7 +190,7 @@ public voteCount(id, key)
 	
 	if (get_cvar_float("amx_vote_answers"))
 	{
-		new name[32]
+		new name[MAX_NAME_LENGTH]
 		
 		get_user_name(id, name, 31)
 		client_print(0, print_chat, "%L", LANG_PLAYER, "X_VOTED_FOR", name, key + 1)
@@ -353,7 +353,7 @@ public actionVoteMapMenu(id, key)
 			set_task(vote_time, "checkVotes", 34567 + id)
 
 			new menuBody[512]
-			new players[32]
+			new players[MAX_PLAYERS]
 			new pnum, keys, len
 
 			get_players(players, pnum)
@@ -388,7 +388,7 @@ public actionVoteMapMenu(id, key)
 			keys |= MENU_KEY_0
 			show_menu(id, keys, menuBody, iVoteTime, menuName)
 
-			new authid[32], name[32]
+			new authid[32], name[MAX_NAME_LENGTH]
 			
 			get_user_authid(id, authid, 31)
 			get_user_name(id, name, 31)
@@ -466,7 +466,7 @@ public actionMapsMenu(id, key)
 				message_end()
 			}
 			
-			new authid[32], name[32]
+			new authid[32], name[MAX_NAME_LENGTH]
 			
 			get_user_authid(id, authid, 31)
 			get_user_name(id, name, 31)
diff --git a/plugins/menufront.sma b/plugins/menufront.sma
index d5c14c73..415fca42 100755
--- a/plugins/menufront.sma
+++ b/plugins/menufront.sma
@@ -41,7 +41,7 @@
 #define MENUITEMSPERPAGE	8
 //#define MENUS_NUMBER 16
 
-new g_menuPosition[33]
+new g_menuPosition[MAX_PLAYERS]
 new g_menusNumber = 0
 new g_menuBody[MAXMENUS][STRINGSIZE]
 new bool:g_menuBodyPhrase[MAXMENUS]
@@ -51,7 +51,7 @@ new g_menuPlugin[MAXMENUS][STRINGSIZE]
 
 new g_coloredMenus
 
-new g_clientMenuPosition[33]
+new g_clientMenuPosition[MAX_PLAYERS]
 new g_clientMenusNumber = 0
 new g_clientMenuBody[MAXMENUS][STRINGSIZE]
 new bool:g_clientMenuBodyPhrase[MAXMENUS]
diff --git a/plugins/multilingual.sma b/plugins/multilingual.sma
index 7ecf4c22..ddb91a1c 100755
--- a/plugins/multilingual.sma
+++ b/plugins/multilingual.sma
@@ -36,7 +36,7 @@
 
 #define DISPLAY_MSG		// Comment to disable message on join
 
-new g_menuLang[33][2]
+new g_menuLang[MAX_PLAYERS][2]
 new g_serverLang
 new g_langNum
 new g_coloredMenus
diff --git a/plugins/ns/idlekicker.sma b/plugins/ns/idlekicker.sma
index 29b44036..f7f6a72f 100755
--- a/plugins/ns/idlekicker.sma
+++ b/plugins/ns/idlekicker.sma
@@ -39,18 +39,16 @@
 #define CHECK_FREQ		5			// This is also the warning message frequency.
 #define CLASS_GESTATE	9
 
-new g_oldangles[33][3]
-new g_idletime[33]
-new bool:g_spawned[33] = {true, ...}
-new g_class[33]	// stored info from the "ScoreInfo" message
+new g_oldangles[MAX_PLAYERS][3]
+new g_idletime[MAX_PLAYERS]
+new bool:g_spawned[MAX_PLAYERS] = {true, ...}
+new g_class[MAX_PLAYERS]	// stored info from the "ScoreInfo" message
 
 new mp_tournamentmode;
 new amx_idle_time;
 new amx_idle_min_players;
 new amx_idle_ignore_immunity;
 
-new maxplayers;
-
 public plugin_init() {
 	register_plugin("Idle Player Remover",AMXX_VERSION_STR,"AMXX Dev Team") 
 	
@@ -71,15 +69,12 @@ public plugin_init() {
 	{
 		register_event("ScoreInfo","msgScoreInfo","a")
 	}
-	
-	
-	maxplayers=get_maxplayers();
 }
 
 public checkPlayers() {
 	if (get_pcvar_num(mp_tournamentmode)) return PLUGIN_HANDLED
 
-	for (new i = 1; i <= maxplayers; i++) {
+	for (new i = 1; i <= MaxClients; i++) {
 		if (is_user_alive(i) && g_class[i]!=CLASS_GESTATE && is_user_connected(i) && !is_user_bot(i) && !is_user_hltv(i) && g_spawned[i]) {
 			if ( !get_pcvar_num(amx_idle_ignore_immunity) ) {
 				if ( access(i, ADMIN_IMMUNITY) ) continue
@@ -116,7 +111,7 @@ check_idletime(id) {
 			new timeleft = maxidletime - g_idletime[id]
 			client_print(id, print_chat, "[AMXX] You have %d seconds to move or you will be kicked for being idle", timeleft)
 		} else if (g_idletime[id] > maxidletime) {
-			new name[32]
+			new name[MAX_NAME_LENGTH]
 			get_user_name(id, name, 31)
 			client_print(0, print_chat, "[AMXX] %s was kicked for being idle longer than %d seconds", name, maxidletime)
 			log_amx("%s was kicked for being idle longer than %d seconds", name, maxidletime)
diff --git a/plugins/ns/nscommands.sma b/plugins/ns/nscommands.sma
index 5ddef815..a28bf38f 100755
--- a/plugins/ns/nscommands.sma
+++ b/plugins/ns/nscommands.sma
@@ -71,8 +71,8 @@ enum {
 };
 
 
-new g_Class[33]; // stored info from the "ScoreInfo" message
-new g_Team[33];
+new g_Class[MAX_PLAYERS]; // stored info from the "ScoreInfo" message
+new g_Team[MAX_PLAYERS];
 
 new g_ScoreInfo_Class;
 new g_ScoreInfo_Team;
@@ -102,7 +102,7 @@ public plugin_init() {
 
   // clear class info..
   new i=0;
-  while (i<33) {
+  while (iget_maxplayers())
+  if (id<1||id>MaxClients)
     return -1;
   if (g_Class[id]==PLAYERCLASS_SPECTATOR)
     return 1;
@@ -167,7 +167,7 @@ public cmdRandom(id,level,cid) {
     read_argv(1,arg,31)
     new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
     if (!player) return PLUGIN_HANDLED
-    new name[32],name_targ[32];
+    new name[MAX_NAME_LENGTH],name_targ[MAX_NAME_LENGTH];
     new auth[32],auth_targ[32];
     get_user_name(id,name,31);
     get_user_name(player,name_targ,31);
@@ -182,7 +182,7 @@ public cmdRandom(id,level,cid) {
   else {
     new cur=0;
     new i=1;
-    while (i<%s><>^" random all",name,get_user_userid(id),auth);
@@ -215,7 +215,7 @@ public randomStep(index) {
     if (g_Team[index] == 0 && !(get_user_flags(index) & ADMIN_IMMUNITY)) {
       client_cmd(index, "%s", g_AutoAssignAck);
     }
-    if (++index > get_maxplayers()) {
+    if (++index > MaxClients) {
     	return PLUGIN_HANDLED_MAIN
     }
 	}
@@ -233,7 +233,7 @@ public cmdReadyRoom(id,level,cid) {
     read_argv(1,arg,31)
     new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
     if (!player) return PLUGIN_HANDLED
-    new name[32],name_targ[32];
+    new name[MAX_NAME_LENGTH],name_targ[MAX_NAME_LENGTH];
     new auth[32],auth_targ[32];
     get_user_name(id,name,31);
     get_user_name(player,name_targ,31);
@@ -248,7 +248,7 @@ public cmdReadyRoom(id,level,cid) {
   else {
     new cur=0;
     new i=1;
-    while (i<%s><>^" ready room all",name,get_user_userid(id),auth);
@@ -279,7 +279,7 @@ public rrStep(index) {
     if (is_user_connected(index) && g_Team[index]!=0) {
       client_cmd(index, "%s", g_ReadyRoomAck)
     }
-    if (++index > get_maxplayers()) {
+    if (++index > MaxClients) {
     	return PLUGIN_HANDLED_MAIN
     }
 	}
@@ -300,7 +300,7 @@ public cmdTeamTwo(id,level,cid) {
       client_print(id,print_chat,"[AMXX] That user is already on team two.");
       return PLUGIN_HANDLED_MAIN;
     }
-    new name[32],name_targ[32];
+    new name[MAX_NAME_LENGTH],name_targ[MAX_NAME_LENGTH];
     new auth[32],auth_targ[32];
     get_user_name(id,name,31);
     get_user_name(player,name_targ,31);
@@ -328,7 +328,7 @@ public cmdTeamOne(id,level,cid) {
       client_print(id,print_chat,"[AMXX] That user is already on team one.");
       return PLUGIN_HANDLED_MAIN;
     }
-    new name[32],name_targ[32];
+    new name[MAX_NAME_LENGTH],name_targ[MAX_NAME_LENGTH];
     new auth[32],auth_targ[32];
     get_user_name(id,name,31);
     get_user_name(player,name_targ,31);
@@ -350,9 +350,9 @@ public cmdUnComm(id,level,cid) {
   if (!cmd_access(id,level,cid,1))
     return PLUGIN_HANDLED
   new comm = UTIL_FindCommander();
-  if (comm>0&&comm<=get_maxplayers()) {
+  if (comm>0&&comm<=MaxClients) {
     client_cmd(comm, "%s", g_StopCommAck);
-    new name[32],name_targ[32];
+    new name[MAX_NAME_LENGTH],name_targ[MAX_NAME_LENGTH];
     new auth[32],auth_targ[32];
     get_user_name(id,name,31);
     get_user_name(comm,name_targ,31);
diff --git a/plugins/ns/plmenu.sma b/plugins/ns/plmenu.sma
index 65d1a232..33446847 100644
--- a/plugins/ns/plmenu.sma
+++ b/plugins/ns/plmenu.sma
@@ -36,14 +36,14 @@
 #include 
 #include 
 
-new g_menuPosition[33]
-new g_menuPlayers[33][32]
-new g_menuPlayersNum[33]
-new g_menuOption[33]
-new g_menuSettings[33]
+new g_menuPosition[MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayersNum[MAX_PLAYERS]
+new g_menuOption[MAX_PLAYERS]
+new g_menuSettings[MAX_PLAYERS]
 
-new g_menuSelect[33][64]
-new g_menuSelectNum[33]
+new g_menuSelect[MAX_PLAYERS][64]
+new g_menuSelectNum[MAX_PLAYERS]
 
 #define MAX_CLCMDS 24
 
@@ -325,7 +325,7 @@ public actionBanMenu(id, key)
 				return PLUGIN_HANDLED
 			}
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-			new name[32], name2[32], authid[32], authid2[32]
+			new name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH], authid[32], authid2[32]
 		
 			get_user_name(player, name2, 31)
 			get_user_authid(id, authid, 31)
@@ -338,8 +338,7 @@ public actionBanMenu(id, key)
 
 			if ( !banTime ) // permanent
 			{
-				new maxpl = get_maxplayers();
-				for (new i = 1; i <= maxpl; i++)
+				for (new i = 1; i <= MaxClients; i++)
 				{
 					show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM");
 				}
@@ -348,8 +347,7 @@ public actionBanMenu(id, key)
 			{
 				new tempTime[32];
 				formatex(tempTime,sizeof(tempTime)-1,"%d",banTime);
-				new maxpl = get_maxplayers();
-				for (new i = 1; i <= maxpl; i++)
+				for (new i = 1; i <= MaxClients; i++)
 				{
 					show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime);
 				}
@@ -400,7 +398,7 @@ displayBanMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -491,7 +489,7 @@ public actionSlapMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-			new name2[32]
+			new name2[MAX_NAME_LENGTH]
 			
 			get_user_name(player, name2, 31)
 
@@ -502,7 +500,7 @@ public actionSlapMenu(id, key)
 				return PLUGIN_HANDLED
 			}
 
-			new authid[32], authid2[32], name[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH]
 
 			get_user_authid(id, authid, 31)
 			get_user_authid(player, authid2, 31)
@@ -541,7 +539,7 @@ displaySlapMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32], team[4]
+	new name[MAX_NAME_LENGTH], team[4]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -624,7 +622,7 @@ public actionKickMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
-			new authid[32], authid2[32], name[32], name2[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
 			
 			get_user_authid(id, authid, 31)
 			get_user_authid(player, authid2, 31)
@@ -658,7 +656,7 @@ displayKickMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 8
 
 	if (start >= g_menuPlayersNum[id])
@@ -728,7 +726,7 @@ public actionTeamMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-			new authid[32], authid2[32], name[32], name2[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
 
 			get_user_name(player, name2, 31)
 			get_user_authid(id, authid, 31)
@@ -762,7 +760,7 @@ displayTeamMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i, iteam
-	new name[32], team[4]
+	new name[MAX_NAME_LENGTH], team[4]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -843,7 +841,7 @@ public actionClcmdMenu(id, key)
 			
 			if (is_user_connected(player))
 			{
-				new command[64], authid[32], name[32], userid[32]
+				new command[64], authid[32], name[MAX_NAME_LENGTH], userid[32]
 				
 				copy(command, 63, g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
 				get_user_authid(player, authid, 31)
@@ -882,7 +880,7 @@ displayClcmdMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
diff --git a/plugins/ns/unstuck.sma b/plugins/ns/unstuck.sma
index 775d97a5..c97fc038 100755
--- a/plugins/ns/unstuck.sma
+++ b/plugins/ns/unstuck.sma
@@ -38,7 +38,7 @@
 #define MAX_ATTEMPTS		128			// How many times to search in an area for a free space
 #define BLOCKED_MASKS		MASK_PLAYER_STUNNED | MASK_ENSNARED | MASK_ALIEN_EMBRYO
 
-new Float:g_lastcmdtime[33]
+new Float:g_lastcmdtime[MAX_PLAYERS]
 
 new amx_unstuck_frequency;
 
diff --git a/plugins/pausecfg.sma b/plugins/pausecfg.sma
index 9892d111..7e4e14e4 100755
--- a/plugins/pausecfg.sma
+++ b/plugins/pausecfg.sma
@@ -42,7 +42,7 @@
 
 #define MAX_SYSTEM 32
  
-new g_menuPos[33]
+new g_menuPos[MAX_PLAYERS]
 new g_fileToSave[64]
 new g_coloredMenus
 new g_Modified
diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma
index 16d18338..41761ba0 100755
--- a/plugins/plmenu.sma
+++ b/plugins/plmenu.sma
@@ -40,14 +40,14 @@
 #include 
 #include 
 
-new g_menuPosition[33]
-new g_menuPlayers[33][32]
-new g_menuPlayersNum[33]
-new g_menuOption[33]
-new g_menuSettings[33]
+new g_menuPosition[MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayersNum[MAX_PLAYERS]
+new g_menuOption[MAX_PLAYERS]
+new g_menuSettings[MAX_PLAYERS]
 
-new g_menuSelect[33][64]
-new g_menuSelectNum[33]
+new g_menuSelect[MAX_PLAYERS][64]
+new g_menuSelectNum[MAX_PLAYERS]
 
 #define MAX_CLCMDS 24
 
@@ -79,7 +79,7 @@ new g_CSTeamiNumbers[3] = {
 	3
 }
 
-new g_CSPlayerCanSwitchFromSpec[33]
+new g_CSPlayerCanSwitchFromSpec[MAX_PLAYERS]
 new g_transferingAdmin
 
 new allow_spectators, mp_limitteams
@@ -273,7 +273,7 @@ public actionBanMenu(id, key)
 				return PLUGIN_HANDLED
 			}
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-			new name[32], name2[32], authid[32], authid2[32]
+			new name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH], authid[32], authid2[32]
 		
 			get_user_name(player, name2, 31)
 			get_user_authid(id, authid, 31)
@@ -286,8 +286,7 @@ public actionBanMenu(id, key)
 
 			if ( !banTime ) // permanent
 			{
-				new maxpl = get_maxplayers();
-				for (new i = 1; i <= maxpl; i++)
+				for (new i = 1; i <= MaxClients; i++)
 				{
 					show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM");
 				}
@@ -296,8 +295,7 @@ public actionBanMenu(id, key)
 			{
 				new tempTime[32];
 				formatex(tempTime,sizeof(tempTime)-1,"%d",banTime);
-				new maxpl = get_maxplayers();
-				for (new i = 1; i <= maxpl; i++)
+				for (new i = 1; i <= MaxClients; i++)
 				{
 					show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime);
 				}
@@ -348,7 +346,7 @@ displayBanMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -442,7 +440,7 @@ public actionSlapMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-			new name2[32]
+			new name2[MAX_NAME_LENGTH]
 			
 			get_user_name(player, name2, 31)
 
@@ -453,7 +451,7 @@ public actionSlapMenu(id, key)
 				return PLUGIN_HANDLED
 			}
 
-			new authid[32], authid2[32], name[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH]
 
 			get_user_authid(id, authid, 31)
 			get_user_authid(player, authid2, 31)
@@ -492,7 +490,7 @@ displaySlapMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32], team[4]
+	new name[MAX_NAME_LENGTH], team[4]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -592,7 +590,7 @@ public actionKickMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
-			new authid[32], authid2[32], name[32], name2[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
 			
 			get_user_authid(id, authid, 31)
 			get_user_authid(player, authid2, 31)
@@ -626,7 +624,7 @@ displayKickMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 8
 
 	if (start >= g_menuPlayersNum[id])
@@ -701,7 +699,7 @@ public Event_TextMsg( id ) // #Only_1_Team_Change
 {
 	if( g_transferingAdmin && is_user_connected(id) && (id == g_transferingAdmin || is_user_connected(g_transferingAdmin)) )
 	{
-		new name[32]
+		new name[MAX_NAME_LENGTH]
 		get_user_name(id, name, charsmax(name))
 		client_print(g_transferingAdmin, print_chat, "%L", g_transferingAdmin, "CANT_PERF_PLAYER", name);
 	}
@@ -729,7 +727,7 @@ public actionTeamMenu(id, key)
 
 			g_transferingAdmin = id
 
-			new authid[32], authid2[32], name[32], name2[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
 
 			get_user_name(player, name2, 31)
 			get_user_authid(id, authid, 31)
@@ -838,7 +836,7 @@ displayTeamMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i, iteam
-	new name[32], team[4]
+	new name[MAX_NAME_LENGTH], team[4]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -947,7 +945,7 @@ public actionClcmdMenu(id, key)
 			
 			if (is_user_connected(player))
 			{
-				new command[512], authid[32], name[32], userid[32]
+				new command[512], authid[32], name[MAX_NAME_LENGTH], userid[32]
 				
 				copy(command, charsmax(command), g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
 				get_user_authid(player, authid, 31)
@@ -986,7 +984,7 @@ displayClcmdMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
diff --git a/plugins/pluginmenu.sma b/plugins/pluginmenu.sma
index 5bd59c2a..98992f1f 100644
--- a/plugins/pluginmenu.sma
+++ b/plugins/pluginmenu.sma
@@ -40,25 +40,25 @@ new DisabledCallback;
 new EnabledCallback;
 
 // pcvar that the client is currently modifying
-new CurrentCvar[33];
+new CurrentCvar[MAX_PLAYERS];
 
 // Name of the cvar being modified
-new CurrentCvarName[33][32];
+new CurrentCvarName[MAX_PLAYERS][32];
 
 // Plugin ID that the client is modifying
-new CurrentPlid[33];
+new CurrentPlid[MAX_PLAYERS];
 
 // Page that the client is currently on
-new CurrentPage[33];
+new CurrentPage[MAX_PLAYERS];
 
 // Menu function ID that the client is in
-new CurrentMenuFunction[33] = { -1,... };
+new CurrentMenuFunction[MAX_PLAYERS] = { -1,... };
 
-new CurrentCommand[33][32];
+new CurrentCommand[MAX_PLAYERS][32];
 new cvarmenu_cmdid;
 new cmdmenu_cmdid;
 
-new ExplicitPlugin[33];
+new ExplicitPlugin[MAX_PLAYERS];
 
 public plugin_init()
 {
@@ -431,7 +431,7 @@ public CommandChangeCvar(id)
 		
 		// Copy of admincmd's global output.
 		
-		new Name[32];
+		new Name[MAX_NAME_LENGTH];
 		new AuthID[40];
 		
 		get_user_name(id,Name,sizeof(Name)-1);
@@ -441,8 +441,7 @@ public CommandChangeCvar(id)
 	
 	
 		new cvar_val[64];
-		new maxpl = get_maxplayers();
-		for (new i = 1; i <= maxpl; i++)
+		for (new i = 1; i <= MaxClients; i++)
 		{
 			if (is_user_connected(i) && !is_user_bot(i))
 			{
diff --git a/plugins/statscfg.sma b/plugins/statscfg.sma
index 1c7e5ff2..d11b93bd 100755
--- a/plugins/statscfg.sma
+++ b/plugins/statscfg.sma
@@ -41,7 +41,7 @@ new g_menuData[MAX_MENU_DATA][32]
 new g_menuDataVar[MAX_MENU_DATA][32]
 new g_menuDataId[MAX_MENU_DATA]
 new g_menuDataNum
-new g_menuPosition[33]
+new g_menuPosition[MAX_PLAYERS]
 new g_fileToSave[64]
 new bool:g_modified
 new g_coloredMenus
diff --git a/plugins/telemenu.sma b/plugins/telemenu.sma
index aaf6da68..171d5e3b 100755
--- a/plugins/telemenu.sma
+++ b/plugins/telemenu.sma
@@ -38,7 +38,7 @@
 
 #define MAX_PLAYERS 32 + 1
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][32]
+new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS] = {-1, ...}
 new Float:g_menuOrigin[MAX_PLAYERS][3]
@@ -89,7 +89,7 @@ public actionTelMenu(id, key)
 		default:
 		{
 			new player = g_menuPlayers[id][g_menuPosition[id] * 6 + key]
-			new name2[32]
+			new name2[MAX_NAME_LENGTH]
 
 			get_user_name(player, name2, charsmax(name2))
 
@@ -138,7 +138,7 @@ public actionTelMenu(id, key)
 				doTeleport(player, origin, vAngle)
 			}
 
-			new authid[32], authid2[32], name[32]
+			new authid[32], authid2[32], name[MAX_NAME_LENGTH]
 
 			get_user_authid(id, authid, charsmax(authid))
 			get_user_authid(player, authid2, charsmax(authid2))
@@ -178,7 +178,7 @@ displayTelMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 6
 	new bool:blockMenu = (is_user_alive(id) && g_menuOption[id] < 1) ? true : false
 
diff --git a/plugins/tfc/plmenu.sma b/plugins/tfc/plmenu.sma
index b17701b3..b5bfc7ce 100755
--- a/plugins/tfc/plmenu.sma
+++ b/plugins/tfc/plmenu.sma
@@ -36,14 +36,14 @@
 #include 
 #include 
 
-new g_menuPosition[33]
-new g_menuPlayers[33][32]
-new g_menuPlayersNum[33]
-new g_menuOption[33]
-new g_menuSettings[33]
+new g_menuPosition[MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayersNum[MAX_PLAYERS]
+new g_menuOption[MAX_PLAYERS]
+new g_menuSettings[MAX_PLAYERS]
 
-new g_menuSelect[33][64]
-new g_menuSelectNum[33]
+new g_menuSelect[MAX_PLAYERS][64]
+new g_menuSelectNum[MAX_PLAYERS]
 
 #define MAX_CLCMDS 24
 
@@ -138,7 +138,7 @@ public actionBanMenu(id, key)
 			}
 			new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
       
-			new name[32], name2[32], authid[32], authid2[32]
+			new name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH], authid[32], authid2[32]
 			get_user_name(player, name2, 31)
 			get_user_authid(id, authid, 31)
 			get_user_authid(player, authid2, 31)
@@ -215,7 +215,7 @@ displayBanMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -298,7 +298,7 @@ public actionSlapMenu(id,key) {
     default: {
       new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
       
-      new name2[32]
+      new name2[MAX_NAME_LENGTH]
       get_user_name(player,name2,31)
       
       if (!is_user_alive(player)) {
@@ -307,7 +307,7 @@ public actionSlapMenu(id,key) {
         return PLUGIN_HANDLED
       }
             
-      new authid[32],authid2[32], name[32]
+      new authid[32],authid2[32], name[MAX_NAME_LENGTH]
 
       get_user_authid(id,authid,31)
       get_user_authid(player,authid2,31)
@@ -351,7 +351,7 @@ displaySlapMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -427,7 +427,7 @@ public actionKickMenu(id,key)
     default: {
       new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key]
 
-      new authid[32],authid2[32], name[32], name2[32]
+      new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
       get_user_authid(id,authid,31)
       get_user_authid(player,authid2,31)
       get_user_name(id,name,31)
@@ -461,7 +461,7 @@ displayKickMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 8
 
 	if (start >= g_menuPlayersNum[id])
@@ -530,7 +530,7 @@ public actionTeamMenu(id,key) {
     case 9: displayTeamMenu(id,--g_menuPosition[id])
     default: {
       new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
-      new authid[32],authid2[32], name[32], name2[32]
+      new authid[32],authid2[32], name[MAX_NAME_LENGTH], name2[MAX_NAME_LENGTH]
       get_user_name(player,name2,31)
       get_user_authid(id,authid,31)
       get_user_authid(player,authid2,31)
@@ -570,7 +570,7 @@ displayTeamMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i, iteam
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
@@ -647,7 +647,7 @@ public actionClcmdMenu(id,key) {
       new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
       new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
       if (is_user_connected(player)) {
-        new command[64], authid[32], name[32], userid[32]
+        new command[64], authid[32], name[MAX_NAME_LENGTH], userid[32]
         copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
         get_user_authid(player,authid,31)
         get_user_name(player,name,31)
@@ -680,7 +680,7 @@ displayClcmdMenu(id, pos)
 	new menuBody[512]
 	new b = 0
 	new i
-	new name[32]
+	new name[MAX_NAME_LENGTH]
 	new start = pos * 7
 
 	if (start >= g_menuPlayersNum[id])
diff --git a/plugins/tfc/stats.sma b/plugins/tfc/stats.sma
index d13cc83f..d180f741 100755
--- a/plugins/tfc/stats.sma
+++ b/plugins/tfc/stats.sma
@@ -47,20 +47,20 @@ public DoubleKill
 public DoubleKillSound
 public BulletDamage
 
-new g_streakKills[33][2]
-new g_multiKills[33][2]
+new g_streakKills[MAX_PLAYERS][2]
+new g_multiKills[MAX_PLAYERS][2]
 new Float:g_prevKill
 new g_prevKillerId
 new g_KillCount;
 
-new g_userPosition[33]
-new g_userState[33]
-new g_userPlayers[33][32]
+new g_userPosition[MAX_PLAYERS]
+new g_userState[MAX_PLAYERS]
+new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
 new g_Buffer[2048]
 
 
-new g_Killers[33][4]
-new Float:g_DeathStats[33]
+new g_Killers[MAX_PLAYERS][4]
+new Float:g_DeathStats[MAX_PLAYERS]
 
 new g_center1_sync
 new g_center2_sync
@@ -240,7 +240,7 @@ public cmdRank(id){
 }
 
 displayRank(id,dest) {
-  new name[32], stats[8], body[8]
+  new name[MAX_NAME_LENGTH], stats[8], body[8]
   new rank_pos = get_user_stats(id,stats,body)
   new pos = format(g_Buffer,2047,"Kills: %d^nDeaths: %d^nTKs: %d^nDamage: %d^nHits: %d^nShots: %d^n^n",
     stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
@@ -264,7 +264,7 @@ public cmdTop15(id) {
 
 /* get top 15 */
 getTop15(){
-  new stats[8], body[8], name[32]
+  new stats[8], body[8], name[MAX_NAME_LENGTH]
   new pos = copy(g_Buffer,2047,"#   nick                           kills/deaths    TKs      hits/shots/headshots^n")
   new imax = get_statsnum()
   if (imax > 15) imax = 15
@@ -278,14 +278,14 @@ getTop15(){
 
 public endGameStats(){
   if ( EndPlayer ){
-    new players[32], inum
+    new players[MAX_PLAYERS], inum
     get_players(players,inum)
     for(new i = 0; i < inum; ++i){
       displayStats(players[i],players[i])
     }
   } 
   else if ( EndTop15 ){
-    new players[32], inum
+    new players[MAX_PLAYERS], inum
     get_players(players,inum)
     getTop15()
     for(new i = 0; i < inum; ++i)
@@ -310,10 +310,9 @@ public cmdStats(id){
 
 /* build list of attackers */ 
 getAttackers(id) { 
-  new name[32],wpn[32], stats[8],body[8],found=0 
+  new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0 
   new pos = copy(g_Buffer,2047,"Attackers:^n") 
-  new amax = get_maxplayers() 
-  for(new a = 1; a <= amax; ++a){ 
+  for(new a = 1; a <= MaxClients; ++a){ 
 
     if(get_user_astats(id,a,stats,body,wpn,31)){ 
       found = 1 
@@ -331,10 +330,9 @@ getAttackers(id) {
 
 /* build list of victims */ 
 getVictims(id) { 
-  new name[32],wpn[32], stats[8],body[8],found=0 
+  new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0 
   new pos = copy(g_Buffer,2047,"Victims:^n") 
-  new amax = get_maxplayers() 
-  for(new a = 1; a <= amax; ++a){ 
+  for(new a = 1; a <= MaxClients; ++a){ 
     if(get_user_vstats(id,a,stats,body,wpn,31)){ 
       found = 1 
       if (stats[1]) 
@@ -361,7 +359,7 @@ getHits(id,killer) {
 
 /* build list of hits for say hp */ 
 getMyHits(id,killed) { 
-  new name[32], stats[8], body[8], found = 0 
+  new name[MAX_NAME_LENGTH], stats[8], body[8], found = 0 
   get_user_name(killed,name,31) 
   new pos = format(g_Buffer,2047,"You hit %s in:",name) 
   get_user_vstats(id,killed,stats,body) 
@@ -384,7 +382,7 @@ public cmdKiller(id) {
     return PLUGIN_HANDLED
   }
   if (g_Killers[id][0]) {
-    new name[32], stats[8], body[8], wpn[33], mstats[8], mbody[8]
+    new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[33], mstats[8], mbody[8]
     get_user_name(g_Killers[id][0],name,31)
     get_user_astats(id,g_Killers[id][0],stats,body,wpn,31)
     client_print(id,print_chat,"%s killed you with %s from distance of %.2f meters",  name,wpn,float(g_Killers[id][3]) * 0.0254 )
@@ -436,7 +434,7 @@ showStatsMenu(id,pos){
   if (start >= inum) start = pos = g_userPosition[id] = 0
 
   new len = format(menu_body,511,"Server Stats %d/%d^n^n",pos + 1,((inum/max_menupos)+((inum%max_menupos)?1:0)))
-  new name[32], end = start + max_menupos, keys = (1<<9)|(1<<7)
+  new name[MAX_NAME_LENGTH], end = start + max_menupos, keys = (1<<9)|(1<<7)
   if (end > inum) end = inum
   for(new a = start; a < end; ++a){
     get_user_name(g_userPlayers[id][a],name,31)
@@ -474,7 +472,7 @@ public client_damage(attacker,victim,damage,wpnindex,hitplace,TA){
 
 /* save state at death */ 
 public client_death(killer,victim,wpnindex,hitplace,TK){
-  new killer_name[32]
+  new killer_name[MAX_NAME_LENGTH]
   get_user_name(killer,killer_name,31) 
 
   if ( KillingStreak || KillingStreakSound ){ 
@@ -486,7 +484,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
   new headshot = ( hitplace == HIT_HEAD ) ? 1:0
   new selfKill = ( killer == victim ) ? 1:0
 
-  new victim_name[32] 
+  new victim_name[MAX_NAME_LENGTH] 
   get_user_name(victim,victim_name,31) 
 
   new Float:statstime = get_cvar_float("tfcstats_statstime")
@@ -548,7 +546,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
       if ( (a >>= 1) > 6 ) a = 6
       if ( KillingStreak ){
         set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1)
-        for (new i=1;i<=get_maxplayers();i++){
+        for (new i=1;i<=MaxClients;i++){
           if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
             continue
           ShowSyncHudMsg(i, g_left_sync, g_KillingMsg[ a ], killer_name) 
@@ -572,7 +570,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
   if ( xmod_is_melee_wpn(wpnindex) && ( KnifeKill || KnifeKillSound )  ){
     if ( KnifeKill ){
       set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1)
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
 
           continue
@@ -584,7 +582,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
   else if ( grenade ){
     if ( GrenadeKill ){
       set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
           continue
         ShowSyncHudMsg(i, g_center1_sync, g_HeMessages[ random_num(0,3)],killer_name,victim_name) 
@@ -601,7 +599,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
       replace( message, sizeof(message)-1, "$wn", weapon )    
       replace( message, sizeof(message)-1, "$kn", killer_name )
       set_hudmessage(100, 100, 255, -1.0, 0.19, 0, 6.0, 6.0, 0.5, 0.15, -1) 
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
           continue
         ShowSyncHudMsg(i, g_center2_sync, "%s", message) 
@@ -635,7 +633,7 @@ public showDoubleKill(){
 	  return PLUGIN_CONTINUE
 
   if ( DoubleKill ) {
-    new name[32],message[128]
+    new name[MAX_NAME_LENGTH],message[128]
     get_user_name(g_prevKillerId,name,31)
     copy( message, 127, g_DoubleKillMsg[pos] )
     replace( message, 127 , "$kn", name )
@@ -645,7 +643,7 @@ public showDoubleKill(){
       replace( message, 127 , "$kk", kills )
     }
     set_hudmessage(65, 102, 158, -1.0, 0.25, 0, 6.0, 6.0, 0.5, 0.15, -1)
-    for (new i=1;i<=get_maxplayers();i++){
+    for (new i=1;i<=MaxClients;i++){
       if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
         continue
       show_hudmessage(i, "%s", message) 
@@ -664,11 +662,11 @@ public checkKills(param[]){
     a -= 3 
     if ( a > -1 ){
       if ( MultiKill ) {
-        new name[32]
+        new name[MAX_NAME_LENGTH]
         get_user_name(id,name,31)
         set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, -1)
         if ( a > 6 ) a = 6
-        for (new i=1;i<=get_maxplayers();i++){
+        for (new i=1;i<=MaxClients;i++){
           if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
             continue
           ShowSyncHudMsg(i, g_left_sync, g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1]) 
diff --git a/plugins/tfc/stats_logging.sma b/plugins/tfc/stats_logging.sma
index 0f24308b..6c739068 100755
--- a/plugins/tfc/stats_logging.sma
+++ b/plugins/tfc/stats_logging.sma
@@ -35,8 +35,8 @@
 #include 
 #include 
 
-new g_pingSum[33]
-new g_pingCount[33]
+new g_pingSum[MAX_PLAYERS]
+new g_pingCount[MAX_PLAYERS]
 
 public plugin_init()
   register_plugin("TFC Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@@ -44,7 +44,7 @@ public plugin_init()
 public client_disconnect(id) {
   if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
   remove_task( id )
-  new szTeam[16],szName[32],szAuthid[32], iStats[8], iHits[8], szWeapon[24]
+  new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[24]
   new iUserid = get_user_userid( id )
   get_user_team(id, szTeam, 15 )
   get_user_name(id, szName ,31 )
diff --git a/plugins/timeleft.sma b/plugins/timeleft.sma
index 5c67c58e..dd9339a9 100755
--- a/plugins/timeleft.sma
+++ b/plugins/timeleft.sma
@@ -266,7 +266,7 @@ public timeRemain(param[])
 			
 			if (flags & TD_BOTTOM_WHITE_TEXT)
 			{
-				new players[32], pnum, plr
+				new players[MAX_PLAYERS], pnum, plr
 				
 				get_players(players, pnum, "c")
 
diff --git a/plugins/ts/stats.sma b/plugins/ts/stats.sma
index 4c09605b..6bf48ab9 100755
--- a/plugins/ts/stats.sma
+++ b/plugins/ts/stats.sma
@@ -49,12 +49,12 @@ public BulletDamage
 public TAInfo
 public FragInfo 
 
-new g_userPosition[33]
-new g_userState[33]
-new g_userPlayers[33][32]
+new g_userPosition[MAX_PLAYERS]
+new g_userState[MAX_PLAYERS]
+new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
 new g_Buffer[2048]
-new g_Killers[33][3] 
-new Float:g_DeathStats[33]
+new g_Killers[MAX_PLAYERS][3] 
+new Float:g_DeathStats[MAX_PLAYERS]
 
 new g_center1_sync
 new g_damage_sync
@@ -209,7 +209,7 @@ public cmdTop15(id) {
 
 /* get top 15 */
 getTop15(){
-  new stats[8], body[8], name[32]
+  new stats[8], body[8], name[MAX_NAME_LENGTH]
   new pos = copy(g_Buffer,2047,"#   nick                           kills/deaths    TKs      hits/shots/headshots^n")
   new imax = get_statsnum()
   if (imax > 15) imax = 15
@@ -223,13 +223,13 @@ getTop15(){
 
 public endGameStats(){
   if ( EndPlayer ){
-    new players[32], inum
+    new players[MAX_PLAYERS], inum
     get_players(players,inum)
     for(new i = 0; i < inum; ++i)
       displayStats(players[i],players[i])
   } 
   else if ( EndTop15 ) {
-    new players[32], inum
+    new players[MAX_PLAYERS], inum
     get_players(players,inum)
     getTop15()
     for(new i = 0; i < inum; ++i)
@@ -252,10 +252,9 @@ public cmdStats(id){
 
 /* build list of attackers */ 
 getAttackers(id) { 
-  new name[32],wpn[32], stats[8],body[8],found=0 
+  new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0 
   new pos = copy(g_Buffer,2047,"Attackers:^n") 
-  new amax = get_maxplayers() 
-  for(new a = 1; a <= amax; ++a){ 
+  for(new a = 1; a <= MaxClients; ++a){ 
     if(get_user_astats(id,a,stats,body,wpn,31)){ 
       found = 1 
       if (stats[0]) 
@@ -271,10 +270,9 @@ getAttackers(id) {
 
 /* build list of victims */ 
 getVictims(id) { 
-  new name[32],wpn[32], stats[8],body[8],found=0 
+  new name[MAX_NAME_LENGTH],wpn[32], stats[8],body[8],found=0 
   new pos = copy(g_Buffer,2047,"Victims:^n") 
-  new amax = get_maxplayers() 
-  for(new a = 1; a <= amax; ++a){ 
+  for(new a = 1; a <= MaxClients; ++a){ 
     if(get_user_vstats(id,a,stats,body,wpn,31)){ 
       found = 1 
       if (stats[1]) 
@@ -301,7 +299,7 @@ getHits(id,killer) {
 
 /* build list of hits for say hp */ 
 getMyHits(id,killed) { 
-  new name[32], stats[8], body[8], found = 0 
+  new name[MAX_NAME_LENGTH], stats[8], body[8], found = 0 
   get_user_name(killed,name,31) 
   new pos = format(g_Buffer,2047,"You hit %s in:",name) 
   get_user_vstats(id,killed,stats,body) 
@@ -317,7 +315,7 @@ getMyHits(id,killed) {
 public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) { 
   if ( TA ){
     if ( TAInfo && is_user_alive(victim) ){
-      new attacker_name[32]
+      new attacker_name[MAX_NAME_LENGTH]
       get_user_name(attacker,attacker_name,31) 
       client_print(0,print_chat,"%s attacked a teammate",attacker_name)
     }
@@ -334,7 +332,7 @@ public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) {
 }
 
 public client_death(killer,victim,wpnindex,hitplace,TK){
-  new killer_name[32]
+  new killer_name[MAX_NAME_LENGTH]
   get_user_name(killer,killer_name,31) 
 
   if ( TK ){
@@ -348,7 +346,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
   new grenade = ( wpnindex == TSW_M61GRENADE ) ? 1:0
   new headshot = ( hitplace == HIT_HEAD ) ? 1:0
 
-  new victim_name[32] 
+  new victim_name[MAX_NAME_LENGTH] 
   get_user_name(victim,victim_name,31) 
 
   if ( killer == victim ){
@@ -375,7 +373,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
 
   if ( grenade && GrenadeKill ){
       set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, -1) 
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
           continue
         show_hudmessage(i, g_HeMessages[ random_num(0,3)],killer_name,victim_name) 
@@ -390,7 +388,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
       replace( message, sizeof(message)-1 , "$wn", weapon )    
       replace( message, sizeof(message)-1, "$kn", killer_name )
       set_hudmessage(100, 100, 255, -1.0, 0.29, 0, 6.0, 6.0, 0.5, 0.15, -1)  
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
           continue
         ShowSyncHudMsg(i, g_center1_sync, "%s", message) 
@@ -402,7 +400,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
   if ( killFlags & TSKF_DOUBLEKILL ){
     if ( DoubleKill ){
       set_hudmessage(65, 102, 158, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, -1)
-      for (new i=1;i<=get_maxplayers();i++){
+      for (new i=1;i<=MaxClients;i++){
         if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
           continue
         show_hudmessage(i,"Wow! %s made a double kill !!!",killer_name) 
@@ -444,7 +442,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
 
 DisplayKillInfo(victim){
   if ( ShowKiller ){ 
-    new name[32], stats[8], body[8], wpn[33], mstats[8], mbody[8] 
+    new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[33], mstats[8], mbody[8] 
     get_user_name(g_Killers[victim][0],name,31) 
     get_user_astats(victim,g_Killers[victim][0],stats,body,wpn,31) 
     get_user_vstats(victim,g_Killers[victim][0],mstats,mbody) 
@@ -469,7 +467,7 @@ DisplayAVList(victim){
 
 DisplayKillerHp(victim,con){
   if ( KillerHp ){
-    new name[32], kmsg[128]
+    new name[MAX_NAME_LENGTH], kmsg[128]
     get_user_name(g_Killers[victim][0],name,31)
     format(kmsg,127,"%s still has %dhp",name,g_Killers[victim][1])
     if ( con ) client_print(victim,print_console, "%s", kmsg)
@@ -497,7 +495,7 @@ public cmdKiller(id) {
     return PLUGIN_HANDLED 
   } 
   if (g_Killers[id][0]) { 
-    new name[32], stats[8], body[8], wpn[33], mstats[8], mbody[8] 
+    new name[MAX_NAME_LENGTH], stats[8], body[8], wpn[33], mstats[8], mbody[8] 
     get_user_name(g_Killers[id][0],name,31) 
     get_user_astats(id,g_Killers[id][0],stats,body,wpn,31) 
     get_user_vstats(id,g_Killers[id][0],mstats,mbody) 
@@ -542,7 +540,7 @@ showStatsMenu(id,pos){
   get_players(g_userPlayers[id],inum)
   if (start >= inum) start = pos = g_userPosition[id] = 0
   new len = format(menu_body,511,"Server Stats %d/%d^n^n",pos + 1,((inum/MAX_MENUPOS)+((inum%MAX_MENUPOS)?1:0)))
-  new name[32], end = start + MAX_MENUPOS, keys = (1<<9)|(1<<7)
+  new name[MAX_NAME_LENGTH], end = start + MAX_MENUPOS, keys = (1<<9)|(1<<7)
   if (end > inum) end = inum
   for(new a = start; a < end; ++a){
     get_user_name(g_userPlayers[id][a],name,31)
diff --git a/plugins/ts/stats_logging.sma b/plugins/ts/stats_logging.sma
index c3b7f398..baf57b2e 100755
--- a/plugins/ts/stats_logging.sma
+++ b/plugins/ts/stats_logging.sma
@@ -10,8 +10,8 @@
 #include 
 #include 
 
-new g_pingSum[33]
-new g_pingCount[33]
+new g_pingSum[MAX_PLAYERS]
+new g_pingCount[MAX_PLAYERS]
 
 public plugin_init()
   register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@@ -19,7 +19,7 @@ public plugin_init()
 public client_disconnect(id) {
   if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
   remove_task( id )
-  new szTeam[16],szName[32],szAuthid[32], iStats[8], iHits[8], szWeapon[16]
+  new szTeam[16],szName[MAX_NAME_LENGTH],szAuthid[32], iStats[8], iHits[8], szWeapon[16]
   new iUserid = get_user_userid( id )
 
   // team 

From 7b96b4df22b5ff5c0d55c3c23b6141baac58c868 Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 12:56:59 +0200
Subject: [PATCH 3/8] Remove unecessary variable.

---
 plugins/adminslots.sma | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/plugins/adminslots.sma b/plugins/adminslots.sma
index 6d8dca36..65190c8a 100755
--- a/plugins/adminslots.sma
+++ b/plugins/adminslots.sma
@@ -38,7 +38,6 @@
 new g_ResPtr
 new g_HidePtr
 new g_sv_visiblemaxplayers
-new g_maxplayers
 
 public plugin_init()
 {
@@ -48,7 +47,6 @@ public plugin_init()
 	g_ResPtr = register_cvar("amx_reservation", "0")
 	g_HidePtr = register_cvar("amx_hideslots", "0")
 	g_sv_visiblemaxplayers = get_cvar_pointer("sv_visiblemaxplayers")
-	g_maxplayers = MaxClients
 }
 
 public plugin_cfg()
@@ -60,14 +58,14 @@ public MapLoaded()
 {
 	if (get_pcvar_num(g_HidePtr))
 	{
-		setVisibleSlots(get_playersnum(1), g_maxplayers - get_pcvar_num(g_ResPtr))
+		setVisibleSlots(get_playersnum(1), MaxClients - get_pcvar_num(g_ResPtr))
 	}
 }
 
 public client_authorized(id)
 {
 	new players = get_playersnum(1)
-	new limit = g_maxplayers - get_pcvar_num(g_ResPtr)
+	new limit = MaxClients - get_pcvar_num(g_ResPtr)
 
 	if (access(id, ADMIN_RESERVATION) || (players <= limit))
 	{
@@ -83,7 +81,7 @@ public client_disconnect(id)
 {
 	if (get_pcvar_num(g_HidePtr))
 	{
-		setVisibleSlots(get_playersnum(1) - 1, g_maxplayers - get_pcvar_num(g_ResPtr))
+		setVisibleSlots(get_playersnum(1) - 1, MaxClients - get_pcvar_num(g_ResPtr))
 	}
 }
 
@@ -91,8 +89,8 @@ setVisibleSlots(players, limit)
 {
 	new num = players + 1
 
-	if (players == g_maxplayers)
-		num = g_maxplayers
+	if (players == MaxClients)
+		num = MaxClients
 	else if (players < limit)
 		num = limit
 	

From ee2ae84d7a0964b8716de8fd8757785e8cce6504 Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 15:15:45 +0200
Subject: [PATCH 4/8] Remove MAX_PLAYERS define assocaited to get_players.

---
 plugins/admin.sma             |  4 ++--
 plugins/adminchat.sma         |  8 ++++----
 plugins/admincmd.sma          | 12 ++++++------
 plugins/adminvote.sma         |  2 +-
 plugins/cstrike/miscstats.sma | 10 +++++-----
 plugins/cstrike/statsx.sma    |  8 ++++----
 plugins/dod/plmenu.sma        |  2 +-
 plugins/dod/stats.sma         | 10 +++++-----
 plugins/include/amxmodx.inc   |  2 +-
 plugins/mapsmenu.sma          |  4 ++--
 plugins/ns/plmenu.sma         |  2 +-
 plugins/plmenu.sma            |  2 +-
 plugins/telemenu.sma          |  2 +-
 plugins/tfc/plmenu.sma        |  2 +-
 plugins/tfc/stats.sma         |  6 +++---
 plugins/timeleft.sma          |  2 +-
 plugins/ts/stats.sma          |  6 +++---
 17 files changed, 42 insertions(+), 42 deletions(-)

diff --git a/plugins/admin.sma b/plugins/admin.sma
index 19980456..706c72b8 100755
--- a/plugins/admin.sma
+++ b/plugins/admin.sma
@@ -165,7 +165,7 @@ public addadminfn(id, level, cid)
 			player = cmd_target(id, arg, CMDTARGET_ALLOW_SELF | CMDTARGET_NO_BOTS)
 		} else {
 			new _steamid[44]
-			static _players[MAX_PLAYERS], _num, _pv
+			static _players[32], _num, _pv
 			get_players(_players, _num)
 			for (new _i=0; _i<_num; _i++)
 			{
@@ -602,7 +602,7 @@ public cmdReload(id, level, cid)
 	}
 #endif
 
-	new players[MAX_PLAYERS], num, pv
+	new players[32], num, pv
 	new name[MAX_NAME_LENGTH]
 	get_players(players, num)
 	for (new i=0; i<%s><>^" set xvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg1, arg2);
 	
 	// Display the message to all clients
-	new players[MAX_PLAYERS], pnum, plr;
+	new players[32], pnum, plr;
 	get_players(players, pnum, "ch");
 	for (new i; i=0; pnum--)
diff --git a/plugins/cstrike/statsx.sma b/plugins/cstrike/statsx.sma
index 642d4ab9..a2961c55 100755
--- a/plugins/cstrike/statsx.sma
+++ b/plugins/cstrike/statsx.sma
@@ -138,7 +138,7 @@ new g_iPluginMode                                   = 0
 
 new g_izUserMenuPosition[MAX_PLAYERS]               = {0, ...}
 new g_izUserMenuAction[MAX_PLAYERS]                 = {0, ...}
-new g_izUserMenuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_izUserMenuPlayers[MAX_PLAYERS][32]
 
 new g_izSpecMode[MAX_PLAYERS]                       = {0, ...}
 
@@ -165,7 +165,7 @@ new g_izTeamRndStats[MAX_TEAMS][8]
 new g_izTeamGameStats[MAX_TEAMS][8]
 new g_izUserUserID[MAX_PLAYERS]                     = {0, ...}
 new g_izUserAttackerDistance[MAX_PLAYERS]           = {0, ...}
-new g_izUserVictimDistance[MAX_PLAYERS][MAX_PLAYERS]
+new g_izUserVictimDistance[MAX_PLAYERS][32]
 new g_izUserRndName[MAX_PLAYERS][MAX_NAME_LENGTH + 1]
 new g_izUserRndStats[MAX_PLAYERS][8]
 new g_izUserGameStats[MAX_PLAYERS][8]
@@ -1580,7 +1580,7 @@ endround_stats()
 	if (g_iRoundEndProcessed || !g_iRoundEndTriggered)
 		return
 
-	new iaPlayers[MAX_PLAYERS], iPlayer, iPlayers, id
+	new iaPlayers[32], iPlayer, iPlayers, id
 
 	get_players(iaPlayers, iPlayers)
 
@@ -1632,7 +1632,7 @@ public eventIntermission()
 
 public end_game_stats()
 {
-	new iaPlayers[MAX_PLAYERS], iPlayer, iPlayers, id
+	new iaPlayers[32], iPlayer, iPlayers, id
 
 	if (EndPlayer)
 	{
diff --git a/plugins/dod/plmenu.sma b/plugins/dod/plmenu.sma
index d6af623e..31107e8e 100755
--- a/plugins/dod/plmenu.sma
+++ b/plugins/dod/plmenu.sma
@@ -37,7 +37,7 @@
 #include 
 
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS]
 new g_menuSettings[MAX_PLAYERS]
diff --git a/plugins/dod/stats.sma b/plugins/dod/stats.sma
index e87270ad..ae39ccc8 100755
--- a/plugins/dod/stats.sma
+++ b/plugins/dod/stats.sma
@@ -67,7 +67,7 @@ new g_RoundScore[2]
 
 new g_userPosition[MAX_PLAYERS]
 new g_userState[MAX_PLAYERS]
-new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_userPlayers[MAX_PLAYERS][32]
 new g_Buffer[2048]
 
 new g_Killers[MAX_PLAYERS][3]
@@ -251,14 +251,14 @@ public cmdFF(id){
 public endGameStats(){
   new i
   if ( EndPlayer ){
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
     for(i = 0; i < inum; ++i){
         displayStats_steam(players[i],players[i])
     }
   } 
   else if ( EndTop15 ){
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
 
     new g_Top[8], top = get_cvar_num("dodstats_topvalue") 
@@ -471,7 +471,7 @@ public round_end(){
 
   if ( !EndRoundStats ) return PLUGIN_CONTINUE
 
-  new g_Buffer2[1024], len, players[MAX_PLAYERS], pnum, stats[9],bodyhits[8]
+  new g_Buffer2[1024], len, players[32], pnum, stats[9],bodyhits[8]
   get_players( players , pnum ) 
 
 
@@ -711,7 +711,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK)
 
   if ( headshot && (HeadShotKill || HeadShotKillSound) && !xmod_is_melee_wpn(wpnindex) ){
     if ( HeadShotKill ){
-      new weapon[32], message[256], players[MAX_PLAYERS], pnum
+      new weapon[32], message[256], players[32], pnum
       xmod_get_wpnname(wpnindex,weapon,31) 
 
       get_players(players,pnum,"c")
diff --git a/plugins/include/amxmodx.inc b/plugins/include/amxmodx.inc
index 0ecd8cc8..729b4c4e 100755
--- a/plugins/include/amxmodx.inc
+++ b/plugins/include/amxmodx.inc
@@ -405,7 +405,7 @@ native get_playersnum(flag=0);
 * "g" - ignore case sensitivity.
 * "h" - skip HLTV.
 * Example: Get all alive CTs: get_players(players,num,"ae","CT") */
-native get_players(players[MAX_PLAYERS], &num ,const flags[]="", const team[]="");
+native get_players(players[32], &num ,const flags[]="", const team[]="");
 
 /* Gets argument from command. */
 native read_argv(id,output[],len);
diff --git a/plugins/mapsmenu.sma b/plugins/mapsmenu.sma
index dbc508bf..e67c68b9 100755
--- a/plugins/mapsmenu.sma
+++ b/plugins/mapsmenu.sma
@@ -118,7 +118,7 @@ public actionResult(id, key)
 public checkVotes(id)
 {
 	id -= 34567
-	new num, ppl[MAX_PLAYERS], a = 0
+	new num, ppl[32], a = 0
 	
 	get_players(ppl, num, "c")
 	if (num == 0) num = 1
@@ -353,7 +353,7 @@ public actionVoteMapMenu(id, key)
 			set_task(vote_time, "checkVotes", 34567 + id)
 
 			new menuBody[512]
-			new players[MAX_PLAYERS]
+			new players[32]
 			new pnum, keys, len
 
 			get_players(players, pnum)
diff --git a/plugins/ns/plmenu.sma b/plugins/ns/plmenu.sma
index 33446847..1dab911c 100644
--- a/plugins/ns/plmenu.sma
+++ b/plugins/ns/plmenu.sma
@@ -37,7 +37,7 @@
 #include 
 
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS]
 new g_menuSettings[MAX_PLAYERS]
diff --git a/plugins/plmenu.sma b/plugins/plmenu.sma
index 41761ba0..8eb4673c 100755
--- a/plugins/plmenu.sma
+++ b/plugins/plmenu.sma
@@ -41,7 +41,7 @@
 #include 
 
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS]
 new g_menuSettings[MAX_PLAYERS]
diff --git a/plugins/telemenu.sma b/plugins/telemenu.sma
index 171d5e3b..93ddabd3 100755
--- a/plugins/telemenu.sma
+++ b/plugins/telemenu.sma
@@ -38,7 +38,7 @@
 
 #define MAX_PLAYERS 32 + 1
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS] = {-1, ...}
 new Float:g_menuOrigin[MAX_PLAYERS][3]
diff --git a/plugins/tfc/plmenu.sma b/plugins/tfc/plmenu.sma
index b5bfc7ce..488bec26 100755
--- a/plugins/tfc/plmenu.sma
+++ b/plugins/tfc/plmenu.sma
@@ -37,7 +37,7 @@
 #include 
 
 new g_menuPosition[MAX_PLAYERS]
-new g_menuPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]
 new g_menuOption[MAX_PLAYERS]
 new g_menuSettings[MAX_PLAYERS]
diff --git a/plugins/tfc/stats.sma b/plugins/tfc/stats.sma
index d180f741..7f61e723 100755
--- a/plugins/tfc/stats.sma
+++ b/plugins/tfc/stats.sma
@@ -55,7 +55,7 @@ new g_KillCount;
 
 new g_userPosition[MAX_PLAYERS]
 new g_userState[MAX_PLAYERS]
-new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_userPlayers[MAX_PLAYERS][32]
 new g_Buffer[2048]
 
 
@@ -278,14 +278,14 @@ getTop15(){
 
 public endGameStats(){
   if ( EndPlayer ){
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
     for(new i = 0; i < inum; ++i){
       displayStats(players[i],players[i])
     }
   } 
   else if ( EndTop15 ){
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
     getTop15()
     for(new i = 0; i < inum; ++i)
diff --git a/plugins/timeleft.sma b/plugins/timeleft.sma
index dd9339a9..5c67c58e 100755
--- a/plugins/timeleft.sma
+++ b/plugins/timeleft.sma
@@ -266,7 +266,7 @@ public timeRemain(param[])
 			
 			if (flags & TD_BOTTOM_WHITE_TEXT)
 			{
-				new players[MAX_PLAYERS], pnum, plr
+				new players[32], pnum, plr
 				
 				get_players(players, pnum, "c")
 
diff --git a/plugins/ts/stats.sma b/plugins/ts/stats.sma
index 6bf48ab9..7e58ce89 100755
--- a/plugins/ts/stats.sma
+++ b/plugins/ts/stats.sma
@@ -51,7 +51,7 @@ public FragInfo
 
 new g_userPosition[MAX_PLAYERS]
 new g_userState[MAX_PLAYERS]
-new g_userPlayers[MAX_PLAYERS][MAX_PLAYERS]
+new g_userPlayers[MAX_PLAYERS][32]
 new g_Buffer[2048]
 new g_Killers[MAX_PLAYERS][3] 
 new Float:g_DeathStats[MAX_PLAYERS]
@@ -223,13 +223,13 @@ getTop15(){
 
 public endGameStats(){
   if ( EndPlayer ){
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
     for(new i = 0; i < inum; ++i)
       displayStats(players[i],players[i])
   } 
   else if ( EndTop15 ) {
-    new players[MAX_PLAYERS], inum
+    new players[32], inum
     get_players(players,inum)
     getTop15()
     for(new i = 0; i < inum; ++i)

From 1fe80667a2ef2e1c36eba9e85850f8d6ba82c30b Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 15:25:37 +0200
Subject: [PATCH 5/8] Fix definitively unused variable warning.

---
 plugins/include/amxconst.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/include/amxconst.inc b/plugins/include/amxconst.inc
index 717c99b5..54569483 100755
--- a/plugins/include/amxconst.inc
+++ b/plugins/include/amxconst.inc
@@ -32,7 +32,7 @@
 #define MAX_PLAYERS		33	/* Maximum number of players AMX Mod X supports */
 #define MAX_NAME_LENGTH 32	/* Maximum buffer required to store a client name */
 
-public const MaxClients = 0;	/* Maximum number of players the server supports (dynamic) */
+public stock const MaxClients;	/* Maximum number of players the server supports (dynamic) */
 
 
 #define M_PI 3.1415926535

From da63bcb24b5d309fd962aefd9faa7614f2efaae4 Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 17:14:05 +0200
Subject: [PATCH 6/8] Fix redefinition of constant.

---
 plugins/telemenu.sma | 1 -
 1 file changed, 1 deletion(-)

diff --git a/plugins/telemenu.sma b/plugins/telemenu.sma
index 93ddabd3..7207cc01 100755
--- a/plugins/telemenu.sma
+++ b/plugins/telemenu.sma
@@ -36,7 +36,6 @@
 #include 
 #include 
 
-#define MAX_PLAYERS 32 + 1
 new g_menuPosition[MAX_PLAYERS]
 new g_menuPlayers[MAX_PLAYERS][32]
 new g_menuPlayersNum[MAX_PLAYERS]

From 0347571ee9364e8e51dcf2cc6d610e556a6fb38f Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 17:31:43 +0200
Subject: [PATCH 7/8] Fix some typos and possible bugs.

---
 plugins/admincmd.sma      | 2 +-
 plugins/dod/stats.sma     | 2 +-
 plugins/ns/nscommands.sma | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/plugins/admincmd.sma b/plugins/admincmd.sma
index b1cf25fc..52c16596 100755
--- a/plugins/admincmd.sma
+++ b/plugins/admincmd.sma
@@ -1257,7 +1257,7 @@ public cmdLeave(id, level, cid)
 	
 	new nick[MAX_NAME_LENGTH], ires, pnum = MaxClients, count = 0, lReason[128]
 	
-	for (new b = 1; b < pnum; ++b)
+	for (new b = 1; b <= pnum; ++b)
 	{
 		if (!is_user_connected(b) && !is_user_connecting(b)) continue
 
diff --git a/plugins/dod/stats.sma b/plugins/dod/stats.sma
index ae39ccc8..117e20d6 100755
--- a/plugins/dod/stats.sma
+++ b/plugins/dod/stats.sma
@@ -834,7 +834,7 @@ public client_disconnect(id) {
       else if ( NumOfLeaders == 1 ) 
         client_cmd( LeaderID,"spk misc/takenlead" ) 
       else if ( NumOfLeaders > 1 ) 
-        for ( new i=1; i MaxClients) {
+    if (++index >= MaxClients) {
     	return PLUGIN_HANDLED_MAIN
     }
 	}

From a2b564eaaadf40d6b0d95df8854e6a0bd56c0d07 Mon Sep 17 00:00:00 2001
From: Arkshine 
Date: Sun, 20 Jul 2014 17:48:05 +0200
Subject: [PATCH 8/8] Fix another potantial bug.

---
 plugins/ns/nscommands.sma | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/ns/nscommands.sma b/plugins/ns/nscommands.sma
index 883a7509..e79a9ae3 100755
--- a/plugins/ns/nscommands.sma
+++ b/plugins/ns/nscommands.sma
@@ -215,7 +215,7 @@ public randomStep(index) {
     if (g_Team[index] == 0 && !(get_user_flags(index) & ADMIN_IMMUNITY)) {
       client_cmd(index, "%s", g_AutoAssignAck);
     }
-    if (++index > MaxClients) {
+    if (++index >= MaxClients) {
     	return PLUGIN_HANDLED_MAIN
     }
 	}