Merge pull request #73 from Arkshine/maxclients

Add some generic constants - part 2
This commit is contained in:
Vincent Herbet 2014-07-25 09:56:08 +02:00
commit 0b7bc23a30
35 changed files with 317 additions and 355 deletions

View File

@ -53,7 +53,7 @@ new PLUGINNAME[] = "AMX Mod X"
#define ADMIN_IPADDR (1<<3) #define ADMIN_IPADDR (1<<3)
#define ADMIN_NAME (1<<4) #define ADMIN_NAME (1<<4)
new bool:g_CaseSensitiveName[33]; new bool:g_CaseSensitiveName[MAX_PLAYERS];
// pcvars // pcvars
new amx_mode; new amx_mode;
@ -236,7 +236,7 @@ public addadminfn(id, level, cid)
read_argv(3, password, 63) read_argv(3, password, 63)
new auth[33] 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) if (idtype & ADMIN_LOOKUP)
{ {
get_user_name(player, Comment, sizeof(Comment)-1) get_user_name(player, Comment, sizeof(Comment)-1)
@ -273,7 +273,7 @@ public addadminfn(id, level, cid)
if (player > 0) if (player > 0)
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_info(player, "name", name, 31) get_user_info(player, "name", name, 31)
accessUser(player, name) accessUser(player, name)
} }
@ -603,7 +603,7 @@ public cmdReload(id, level, cid)
#endif #endif
new players[32], num, pv new players[32], num, pv
new name[32] new name[MAX_NAME_LENGTH]
get_players(players, num) get_players(players, num)
for (new i=0; i<num; i++) for (new i=0; i<num; i++)
{ {
@ -821,7 +821,7 @@ public client_infochanged(id)
return PLUGIN_CONTINUE return PLUGIN_CONTINUE
} }
new newname[32], oldname[32] new newname[MAX_NAME_LENGTH], oldname[MAX_NAME_LENGTH]
get_user_name(id, oldname, 31) get_user_name(id, oldname, 31)
get_user_info(id, "name", newname, 31) get_user_info(id, "name", newname, 31)

View File

@ -47,8 +47,8 @@ new amx_show_activity;
new amx_flood_time; new amx_flood_time;
new g_AdminChatFlag = ADMIN_CHAT; new g_AdminChatFlag = ADMIN_CHAT;
new Float:g_Flooding[33] = {0.0, ...} new Float:g_Flooding[MAX_PLAYERS] = {0.0, ...}
new g_Flood[33] = {0, ...} new g_Flood[MAX_PLAYERS] = {0, ...}
public plugin_init() public plugin_init()
{ {
@ -138,7 +138,7 @@ public cmdSayChat(id, level)
} }
new name[32], authid[32], userid new name[MAX_NAME_LENGTH], authid[32], userid
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -225,7 +225,7 @@ public cmdSayAdmin(id)
g_Flooding[id] = nexTime + maxChat g_Flooding[id] = nexTime + maxChat
} }
new message[192], name[32], authid[32], userid new message[192], name[MAX_NAME_LENGTH], authid[32], userid
new players[32], inum, pl new players[32], inum, pl
read_args(message, charsmax(message)) read_args(message, charsmax(message))
@ -267,7 +267,7 @@ public cmdChat(id, level, cid)
if (!message[0]) if (!message[0])
return PLUGIN_HANDLED return PLUGIN_HANDLED
new name[32], players[32], inum, authid[32], userid, pl new name[MAX_NAME_LENGTH], players[32], inum, authid[32], userid, pl
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -295,7 +295,7 @@ public cmdSay(id, level, cid)
if (!cmd_access(id, level, cid, 2)) if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new message[192], name[32], authid[32], userid new message[192], name[MAX_NAME_LENGTH], authid[32], userid
read_args(message, charsmax(message)) read_args(message, charsmax(message))
remove_quotes(message) remove_quotes(message)
@ -316,7 +316,7 @@ public cmdPsay(id, level, cid)
if (!cmd_access(id, level, cid, 3)) if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new name[32] new name[MAX_NAME_LENGTH]
read_argv(1, name, charsmax(name)) read_argv(1, name, charsmax(name))
new priv = cmd_target(id, name, 0) new priv = cmd_target(id, name, 0)
@ -325,7 +325,7 @@ public cmdPsay(id, level, cid)
new length = strlen(name) + 1 new length = strlen(name) + 1
new message[192], name2[32], authid[32], authid2[32], userid, userid2 new message[192], name2[MAX_NAME_LENGTH], authid[32], authid2[32], userid, userid2
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name2, charsmax(name2)) get_user_name(id, name2, charsmax(name2))
@ -361,7 +361,7 @@ public cmdTsay(id, level, cid)
if (!cmd_access(id, level, cid, 3)) if (!cmd_access(id, level, cid, 3))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new cmd[16], color[16], color2[16], message[192], name[32], authid[32], userid = 0 new cmd[16], color[16], color2[16], message[192], name[MAX_NAME_LENGTH], authid[32], userid = 0
read_argv(0, cmd, charsmax(cmd)) read_argv(0, cmd, charsmax(cmd))
new bool:tsay = (tolower(cmd[4]) == 't') new bool:tsay = (tolower(cmd[4]) == 't')

View File

@ -50,7 +50,7 @@ new timelimit;
new p_amx_tempban_maxtime; new p_amx_tempban_maxtime;
// Old connection queue // Old connection queue
new g_Names[OLD_CONNECTION_QUEUE][32]; new g_Names[OLD_CONNECTION_QUEUE][MAX_NAME_LENGTH];
new g_SteamIDs[OLD_CONNECTION_QUEUE][32]; new g_SteamIDs[OLD_CONNECTION_QUEUE][32];
new g_IPs[OLD_CONNECTION_QUEUE][32]; new g_IPs[OLD_CONNECTION_QUEUE][32];
new g_Access[OLD_CONNECTION_QUEUE]; new g_Access[OLD_CONNECTION_QUEUE];
@ -229,7 +229,7 @@ public cmdKick(id, level, cid)
if (!player) if (!player)
return PLUGIN_HANDLED return PLUGIN_HANDLED
new authid[32], authid2[32], name2[32], name[32], userid2, reason[32] new authid[32], authid2[32], name2[MAX_NAME_LENGTH], name[MAX_NAME_LENGTH], userid2, reason[32]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(player, authid2, charsmax(authid2))
@ -263,7 +263,7 @@ public cmdUnban(id, level, cid)
if (!cmd_access(id, level, cid, 2)) if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new arg[32], authid[32], name[32] new arg[32], authid[32], name[MAX_NAME_LENGTH]
read_argv(1, arg, charsmax(arg)) read_argv(1, arg, charsmax(arg))
@ -320,7 +320,7 @@ public cmdAddBan(id, level, cid)
} }
} }
new arg[32], authid[32], name[32], minutes[32], reason[32] new arg[32], authid[32], name[MAX_NAME_LENGTH], minutes[32], reason[32]
read_argv(1, arg, charsmax(arg)) read_argv(1, arg, charsmax(arg))
read_argv(2, minutes, charsmax(minutes)) read_argv(2, minutes, charsmax(minutes))
@ -353,7 +353,7 @@ public cmdAddBan(id, level, cid)
if (isip) if (isip)
{ {
new IP[32]; new IP[32];
new Name[32]; new Name[MAX_NAME_LENGTH];
new dummy[1]; new dummy[1];
new Access; new Access;
for (new i = 0; i < g_Size; i++) for (new i = 0; i < g_Size; i++)
@ -455,7 +455,7 @@ public cmdBan(id, level, cid)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32], name2[32], authid2[32], name[32] new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH]
new userid2 = get_user_userid(player) new userid2 = get_user_userid(player)
get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(player, authid2, charsmax(authid2))
@ -541,7 +541,7 @@ public cmdBanIP(id, level, cid)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32], name2[32], authid2[32], name[32] new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH]
new userid2 = get_user_userid(player) new userid2 = get_user_userid(player)
get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(player, authid2, charsmax(authid2))
@ -616,7 +616,7 @@ public cmdSlay(id, level, cid)
user_kill(player) user_kill(player)
new authid[32], name2[32], authid2[32], name[32] new authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -645,7 +645,7 @@ public cmdSlap(id, level, cid)
if (!player) if (!player)
return PLUGIN_HANDLED return PLUGIN_HANDLED
new spower[32], authid[32], name2[32], authid2[32], name[32] new spower[32], authid[32], name2[MAX_NAME_LENGTH], authid2[32], name[MAX_NAME_LENGTH]
read_argv(2, spower, charsmax(spower)) read_argv(2, spower, charsmax(spower))
@ -686,7 +686,7 @@ public cmdMap(id, level, cid)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -725,7 +725,7 @@ public cmdExtendMap(id, level, cid)
get_mapname(mapname, charsmax(mapname)) get_mapname(mapname, charsmax(mapname))
set_pcvar_num( timelimit , get_pcvar_num( timelimit ) + mns) set_pcvar_num( timelimit , get_pcvar_num( timelimit ) + mns)
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -798,7 +798,7 @@ public cmdCvar(id, level, cid)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -926,7 +926,7 @@ public cmdXvar(id, level, cid)
num_to_str(value, arg2, charsmax(arg2)); num_to_str(value, arg2, charsmax(arg2));
} }
new authid[32], name[32]; new authid[32], name[MAX_NAME_LENGTH];
get_user_authid(id, authid, charsmax(authid)); get_user_authid(id, authid, charsmax(authid));
get_user_name(id, name, charsmax(name)); get_user_name(id, name, charsmax(name));
@ -959,7 +959,7 @@ public cmdPlugins(id, level, cid)
return PLUGIN_HANDLED; return PLUGIN_HANDLED;
} }
new name[32], version[32], author[32], filename[32], status[32] new name[MAX_NAME_LENGTH], version[32], author[32], filename[32], status[32]
new lName[32], lVersion[32], lAuthor[32], lFile[32], lStatus[32] new lName[32], lVersion[32], lAuthor[32], lFile[32], lStatus[32]
format(lName, charsmax(lName), "%L", id, "NAME") format(lName, charsmax(lName), "%L", id, "NAME")
@ -1071,7 +1071,7 @@ public cmdCfg(id, level, cid)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -1111,7 +1111,7 @@ public cmdPause(id, level, cid)
if (!cmd_access(id, level, cid, 1)) if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new authid[32], name[32], slayer = id new authid[32], name[MAX_NAME_LENGTH], slayer = id
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -1179,7 +1179,7 @@ public cmdRcon(id, level, cid)
if (!cmd_access(id, level, cid, 2)) if (!cmd_access(id, level, cid, 2))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new arg[128], authid[32], name[32] new arg[128], authid[32], name[MAX_NAME_LENGTH]
read_args(arg, charsmax(arg)) read_args(arg, charsmax(arg))
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
@ -1198,7 +1198,7 @@ public cmdWho(id, level, cid)
if (!cmd_access(id, level, cid, 1)) if (!cmd_access(id, level, cid, 1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new players[32], inum, cl_on_server[64], authid[32], name[32], flags, sflags[32], plr new players[32], inum, cl_on_server[64], authid[32], name[MAX_NAME_LENGTH], flags, sflags[32], plr
new lImm[16], lRes[16], lAccess[16], lYes[16], lNo[16] new lImm[16], lRes[16], lAccess[16], lYes[16], lNo[16]
formatex(lImm, charsmax(lImm), "%L", id, "IMMU") formatex(lImm, charsmax(lImm), "%L", id, "IMMU")
@ -1255,9 +1255,9 @@ public cmdLeave(id, level, cid)
ltags[ltagsnum++][0] = 0 ltags[ltagsnum++][0] = 0
} }
new nick[32], ires, pnum = get_maxplayers() + 1, count = 0, lReason[128] 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 if (!is_user_connected(b) && !is_user_connecting(b)) continue
@ -1290,7 +1290,7 @@ public cmdLeave(id, level, cid)
console_print(id, "[AMXX] %L", id, "KICKED_CLIENTS", count) console_print(id, "[AMXX] %L", id, "KICKED_CLIENTS", count)
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, charsmax(authid)) get_user_authid(id, authid, charsmax(authid))
get_user_name(id, name, charsmax(name)) get_user_name(id, name, charsmax(name))
@ -1339,7 +1339,7 @@ public cmdLast(id, level, cid)
return PLUGIN_HANDLED; return PLUGIN_HANDLED;
} }
new name[32]; new name[MAX_NAME_LENGTH];
new authid[32]; new authid[32];
new ip[32]; new ip[32];
new flags[32]; new flags[32];

View File

@ -38,7 +38,6 @@
new g_ResPtr new g_ResPtr
new g_HidePtr new g_HidePtr
new g_sv_visiblemaxplayers new g_sv_visiblemaxplayers
new g_maxplayers
public plugin_init() public plugin_init()
{ {
@ -48,7 +47,6 @@ public plugin_init()
g_ResPtr = register_cvar("amx_reservation", "0") g_ResPtr = register_cvar("amx_reservation", "0")
g_HidePtr = register_cvar("amx_hideslots", "0") g_HidePtr = register_cvar("amx_hideslots", "0")
g_sv_visiblemaxplayers = get_cvar_pointer("sv_visiblemaxplayers") g_sv_visiblemaxplayers = get_cvar_pointer("sv_visiblemaxplayers")
g_maxplayers = get_maxplayers()
} }
public plugin_cfg() public plugin_cfg()
@ -60,14 +58,14 @@ public MapLoaded()
{ {
if (get_pcvar_num(g_HidePtr)) 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) public client_authorized(id)
{ {
new players = get_playersnum(1) 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)) if (access(id, ADMIN_RESERVATION) || (players <= limit))
{ {
@ -83,7 +81,7 @@ public client_disconnect(id)
{ {
if (get_pcvar_num(g_HidePtr)) 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 new num = players + 1
if (players == g_maxplayers) if (players == MaxClients)
num = g_maxplayers num = MaxClients
else if (players < limit) else if (players < limit)
num = limit num = limit

View File

@ -77,16 +77,14 @@ public cmdCancelVote(id, level, cid)
if (task_exists(99889988, 1)) if (task_exists(99889988, 1))
{ {
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
get_user_name(id, name, 31) get_user_name(id, name, 31)
log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid) log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session", name, get_user_userid(id), authid)
new maxpl=get_maxplayers();
new msg[256]; 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)) if (is_user_connected(i) && !is_user_bot(i))
{ {
@ -218,7 +216,7 @@ public voteCount(id, key)
{ {
if (get_cvar_num("amx_vote_answers")) if (get_cvar_num("amx_vote_answers"))
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, 31) get_user_name(id, name, 31)
if (g_yesNoVote) if (g_yesNoVote)
@ -304,7 +302,7 @@ public cmdVoteMap(id, level, cid)
g_yesNoVote = 1 g_yesNoVote = 1
} }
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
get_user_name(id, name, 31) get_user_name(id, name, 31)
@ -314,9 +312,8 @@ public cmdVoteMap(id, level, cid)
else 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]) 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]; 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)) 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); 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_authid(id, authid, 31)
get_user_name(id, name, 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]) 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]; 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)) 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) 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_authid(id, authid, 31)
get_user_name(id, name, 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) 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 msg[256];
new right[256]; new right[256];
new dummy[1]; 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)) if (is_user_connected(i) && !is_user_bot(i))
{ {

View File

@ -34,8 +34,8 @@
#include <amxmodx> #include <amxmodx>
new Float:g_Flooding[33] = {0.0, ...} new Float:g_Flooding[MAX_PLAYERS] = {0.0, ...}
new g_Flood[33] = {0, ...} new g_Flood[MAX_PLAYERS] = {0, ...}
new amx_flood_time; new amx_flood_time;

View File

@ -86,10 +86,10 @@ new g_cvarCmd[MAX_CVARS*5][32]
new g_cvarCmdNum new g_cvarCmdNum
new g_cvarNum new g_cvarNum
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menuSelect[33][MAX_CMDS] new g_menuSelect[MAX_PLAYERS][MAX_CMDS]
new g_menuSelectNum[33] new g_menuSelectNum[MAX_PLAYERS]
new g_menuLayer[33] new g_menuLayer[MAX_PLAYERS]
new g_coloredMenus new g_coloredMenus

View File

@ -77,8 +77,8 @@ public GrenadeSuicideSound
const SOUNDFILE_PATH_MAXLEN = 64 const SOUNDFILE_PATH_MAXLEN = 64
const SOUND_SHORTPATH_MAXLEN = SOUNDFILE_PATH_MAXLEN - 10 // 64 (sound/ [ 54 ] .wav) critical value for fast dl const SOUND_SHORTPATH_MAXLEN = SOUNDFILE_PATH_MAXLEN - 10 // 64 (sound/ [ 54 ] .wav) critical value for fast dl
new g_streakKills[33][2] new g_streakKills[MAX_PLAYERS][2]
new g_multiKills[33][2] new g_multiKills[MAX_PLAYERS][2]
new g_C4Timer new g_C4Timer
new g_Defusing new g_Defusing
new g_Planter new g_Planter
@ -87,7 +87,7 @@ new g_LastAnnounce
new g_roundCount new g_roundCount
new Float:g_doubleKill new Float:g_doubleKill
new g_doubleKillId new g_doubleKillId
new g_friend[33] new g_friend[MAX_PLAYERS]
new g_firstBlood new g_firstBlood
new g_center1_sync new g_center1_sync
new g_announce_sync new g_announce_sync
@ -104,8 +104,8 @@ const TASK_DELAYED_NEW_ROUND = 98038
const TEAM_T = 1 const TEAM_T = 1
const TEAM_CT = 2 const TEAM_CT = 2
new g_connected[33] new g_connected[MAX_PLAYERS]
new g_msounds[33] new g_msounds[MAX_PLAYERS]
new const _msound[] = "_msound" new const _msound[] = "_msound"
new g_MultiKillMsg[7][] = new g_MultiKillMsg[7][] =
@ -527,7 +527,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
if ((a > -1) && !(a % 2)) if ((a > -1) && !(a % 2))
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(killer, name, charsmax(name)) get_user_name(killer, name, charsmax(name))
if ((a >>= 1) > 6) if ((a >>= 1) > 6)
@ -648,7 +648,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
{ {
if( LastMan ) 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(cts[0], ctname, charsmax(ctname))
get_user_name(ts[0], tname, charsmax(tname)) get_user_name(ts[0], tname, charsmax(tname))
@ -681,7 +681,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
{ {
if( LastMan ) if( LastMan )
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(g_LastAnnounce, name, charsmax(name)) get_user_name(g_LastAnnounce, name, charsmax(name))
@ -700,7 +700,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
{ {
if (KnifeKill) 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(killer, killer_name, charsmax(killer_name))
get_user_name(victim, victim_name, charsmax(victim_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) 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 ) if( GrenadeKill || GrenadeSuicide )
{ {
get_user_name(killer, killer_name, charsmax(killer_name)) get_user_name(killer, killer_name, charsmax(killer_name))
@ -744,7 +744,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
{ {
if (HeadShotKill && wpnindex) 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[32], pnum, plr
xmod_get_wpnname(wpnindex, weapon_name, charsmax(weapon_name)) xmod_get_wpnname(wpnindex, weapon_name, charsmax(weapon_name))
get_user_name(killer, killer_name, charsmax(killer_name)) get_user_name(killer, killer_name, charsmax(killer_name))
@ -781,7 +781,7 @@ public client_death(killer, victim, wpnindex, hitplace, TK)
{ {
if (DoubleKill) if (DoubleKill)
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(killer, name, charsmax(name)) get_user_name(killer, name, charsmax(name))
@ -813,7 +813,7 @@ public showStatus(id)
{ {
if( PlayerName) 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)) get_user_name(pid, name, charsmax(name))
new color1 = 0, color2 = 0 new color1 = 0, color2 = 0
@ -914,7 +914,7 @@ public checkKills(param[])
if (MultiKill) if (MultiKill)
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, charsmax(name)) 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) 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[]) announceEvent(id, message[])
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, charsmax(name)) 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) set_hudmessage(255, 100, 50, -1.0, 0.30, 0, 6.0, 6.0, 0.5, 0.15, -1)

View File

@ -40,14 +40,14 @@
#define MAXMENUPOS 34 #define MAXMENUPOS 34
new g_Position[33] new g_Position[MAX_PLAYERS]
new g_Modified new g_Modified
new g_blockPos[112] new g_blockPos[112]
new g_saveFile[64] new g_saveFile[64]
new g_Restricted[] = "* This item is restricted *" new g_Restricted[] = "* This item is restricted *"
new g_szWeapRestr[27] = "00000000000000000000000000" new g_szWeapRestr[27] = "00000000000000000000000000"
new g_szEquipAmmoRestr[10] = "000000000" new g_szEquipAmmoRestr[10] = "000000000"
new g_InBuyMenu[33] new g_InBuyMenu[MAX_PLAYERS]
new g_RegisteredMenus[10] new g_RegisteredMenus[10]
new g_menuStrings[6][] = new g_menuStrings[6][] =
@ -304,8 +304,8 @@ new g_Aliases2[MAXMENUPOS][] =
} }
#define AUTOBUYLENGTH 511 #define AUTOBUYLENGTH 511
new g_Autobuy[33][AUTOBUYLENGTH + 1] new g_Autobuy[MAX_PLAYERS][AUTOBUYLENGTH + 1]
//new g_Rebuy[33][AUTOBUYLENGTH + 1] //new g_Rebuy[MAX_PLAYERS][AUTOBUYLENGTH + 1]
bool:IsOurMenuID(id) bool:IsOurMenuID(id)
{ {

View File

@ -35,9 +35,9 @@
#include <amxmodx> #include <amxmodx>
#include <csx> #include <csx>
new g_pingSum[33] new g_pingSum[MAX_PLAYERS]
new g_pingCount[33] new g_pingCount[MAX_PLAYERS]
new g_inGame[33] new g_inGame[MAX_PLAYERS]
public plugin_init() public plugin_init()
{ {
@ -58,7 +58,7 @@ public client_disconnect(id)
remove_task(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 iUserid = get_user_userid(id)
new _max = xmod_get_maxweapons() new _max = xmod_get_maxweapons()

View File

@ -1,4 +1,4 @@
/* AMX Mod X /* AMX Mod X
* StatsX Plugin * StatsX Plugin
* *
* by the AMX Mod X Development Team * by the AMX Mod X Development Team
@ -95,9 +95,6 @@ public SpecRankInfo = 0 // displays rank info when spectating
// Standard Contstants. // Standard Contstants.
#define MAX_TEAMS 2 #define MAX_TEAMS 2
#define MAX_PLAYERS 32 + 1
#define MAX_NAME_LENGTH 31
#define MAX_WEAPON_LENGTH 31 #define MAX_WEAPON_LENGTH 31
#define MAX_TEXT_LENGTH 255 #define MAX_TEXT_LENGTH 255
#define MAX_BUFFER_LENGTH 2047 #define MAX_BUFFER_LENGTH 2047
@ -168,7 +165,7 @@ new g_izTeamRndStats[MAX_TEAMS][8]
new g_izTeamGameStats[MAX_TEAMS][8] new g_izTeamGameStats[MAX_TEAMS][8]
new g_izUserUserID[MAX_PLAYERS] = {0, ...} new g_izUserUserID[MAX_PLAYERS] = {0, ...}
new g_izUserAttackerDistance[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_izUserRndName[MAX_PLAYERS][MAX_NAME_LENGTH + 1]
new g_izUserRndStats[MAX_PLAYERS][8] new g_izUserRndStats[MAX_PLAYERS][8]
new g_izUserGameStats[MAX_PLAYERS][8] new g_izUserGameStats[MAX_PLAYERS][8]
@ -371,7 +368,6 @@ get_attackers(id, sBuffer[MAX_BUFFER_LENGTH + 1])
new izStats[8], izBody[8] new izStats[8], izBody[8]
new iAttacker new iAttacker
new iFound, iLen new iFound, iLen
new iMaxPlayer = get_maxplayers()
iFound = 0 iFound = 0
sBuffer[0] = 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") iLen = formatex(sBuffer, charsmax(sBuffer), "%L:^n", id, "ATTACKERS")
// Get and format attacker list. // 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))) 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 izStats[8], izBody[8]
new iVictim new iVictim
new iFound, iLen new iFound, iLen
new iMaxPlayer = get_maxplayers()
iFound = 0 iFound = 0
sBuffer[0] = 0 sBuffer[0] = 0
@ -446,7 +441,7 @@ get_victims(id, sBuffer[MAX_BUFFER_LENGTH + 1])
else else
iLen = formatex(sBuffer, charsmax(sBuffer), "%L:^n", id, "VICTIMS") 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))) if (get_user_vstats(id, iVictim, izStats, izBody, t_sWpn, charsmax(t_sWpn)))
{ {

View File

@ -36,14 +36,14 @@
#include <amxmisc> #include <amxmisc>
#include <dodx> #include <dodx>
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[33][32] new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[33] new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[33] new g_menuOption[MAX_PLAYERS]
new g_menuSettings[33] new g_menuSettings[MAX_PLAYERS]
new g_menuSelect[33][64] new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[33] new g_menuSelectNum[MAX_PLAYERS]
#define MAX_CLCMDS 24 #define MAX_CLCMDS 24
@ -137,7 +137,7 @@ public actionBanMenu(id, key)
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -214,7 +214,7 @@ displayBanMenu(id,pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -298,7 +298,7 @@ public actionSlapMenu(id,key) {
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32] new name2[MAX_NAME_LENGTH]
get_user_name(player,name2,31) get_user_name(player,name2,31)
if (!is_user_alive(player)) { if (!is_user_alive(player)) {
@ -307,7 +307,7 @@ public actionSlapMenu(id,key) {
return PLUGIN_HANDLED 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(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
@ -352,7 +352,7 @@ displaySlapMenu(id,pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32], team[8] new name[MAX_NAME_LENGTH], team[8]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -427,7 +427,7 @@ public actionKickMenu(id,key)
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key] 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(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
get_user_name(id,name,31) get_user_name(id,name,31)
@ -461,7 +461,7 @@ displayKickMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 8 new start = pos * 8
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -529,7 +529,7 @@ public actionTeamMenu(id,key) {
case 9: displayTeamMenu(id,--g_menuPosition[id]) case 9: displayTeamMenu(id,--g_menuPosition[id])
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] 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_name(player,name2,31)
get_user_authid(id,authid,31) get_user_authid(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
@ -562,7 +562,7 @@ displayTeamMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i, iteam new i, iteam
new name[32], team[8] new name[MAX_NAME_LENGTH], team[8]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -640,7 +640,7 @@ public actionClcmdMenu(id,key) {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1] new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
if (is_user_connected(player)) { 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]]]) copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player,authid,31) get_user_authid(player,authid,31)
get_user_name(player,name,31) get_user_name(player,name,31)
@ -673,7 +673,7 @@ displayClcmdMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])

View File

@ -58,20 +58,20 @@ public EnemyGreKillSound
public LeadSounds public LeadSounds
public MortarKill public MortarKill
new g_streakKills[33][2] new g_streakKills[MAX_PLAYERS][2]
new g_multiKills[33][2] new g_multiKills[MAX_PLAYERS][2]
new Float:g_prevKill new Float:g_prevKill
new g_prevKillerId new g_prevKillerId
new g_KillCount; new g_KillCount;
new g_RoundScore[2] new g_RoundScore[2]
new g_userPosition[33] new g_userPosition[MAX_PLAYERS]
new g_userState[33] new g_userState[MAX_PLAYERS]
new g_userPlayers[33][32] new g_userPlayers[MAX_PLAYERS][32]
new g_Buffer[2048] new g_Buffer[2048]
new g_Killers[33][3] new g_Killers[MAX_PLAYERS][3]
new Float:g_DeathStats[33] new Float:g_DeathStats[MAX_PLAYERS]
new g_damage_sync new g_damage_sync
new g_center1_sync new g_center1_sync
@ -286,10 +286,9 @@ public cmdStats(id){
/* build list of attackers */ /* build list of attackers */
getAttackers(id) { 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 pos = format(g_Buffer,2047,"%L^n",id,"ATTACKERS")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_astats(id,a,stats,body,wpn,31)) if(get_user_astats(id,a,stats,body,wpn,31))
{ {
@ -308,10 +307,9 @@ getAttackers(id) {
/* build list of victims */ /* build list of victims */
getVictims(id) { 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 pos = format(g_Buffer,2047,"%L^n",id,"VICTIMS")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_vstats(id,a,stats,body,wpn,31)) if(get_user_vstats(id,a,stats,body,wpn,31))
{ {
found = 1 found = 1
@ -338,7 +336,7 @@ getHits(id,killer) {
/* build list of hits for say hp */ /* build list of hits for say hp */
getMyHits(id,killed) { 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) get_user_name(killed,name,31)
new pos = format(g_Buffer,2047,"%L",id,"YOU_HIT",name) new pos = format(g_Buffer,2047,"%L",id,"YOU_HIT",name)
get_user_vstats(id,killed,stats,body) get_user_vstats(id,killed,stats,body)
@ -361,7 +359,7 @@ public cmdKiller(id) {
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if (g_Killers[id][0]) { 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_name(g_Killers[id][0],name,31)
get_user_astats(id,g_Killers[id][0],stats,body,wpn,31) get_user_astats(id,g_Killers[id][0],stats,body,wpn,31)
get_user_vstats(id,g_Killers[id][0],mstats,mbody) 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 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 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 if (end > inum) end = inum
for(new a = start; a < end; ++a){ for(new a = start; a < end; ++a){
get_user_name(g_userPlayers[id][a],name,31) 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 new catch = ( ( get_user_team(id) == 1 && GreId == 15 ) || ( get_user_team(id) == 2 && GreId == 16 ) ) ? 1:0
if ( catch ) { if ( catch ) {
if ( GreCatch ){ if ( GreCatch ){
new player_name[32] new player_name[MAX_NAME_LENGTH]
get_user_name(id,player_name,32) 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) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
show_hudmessage(i,"%L",i,"NADE_CAUGHT",player_name) show_hudmessage(i,"%L",i,"NADE_CAUGHT",player_name)
@ -478,7 +476,7 @@ public round_end(){
new score = 0, kills = 0, hs =0 , damage = 0, hits = 0, who1 = 0, who2 = 0, who3 = 0 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){ for(new i = 0; i < pnum; ++i){
get_user_rstats( players[i],stats, bodyhits ) get_user_rstats( players[i],stats, bodyhits )
@ -541,7 +539,7 @@ public client_damage(attacker,victim,damage,wpnindex,hitplace,TA)
{ {
if ( TA ){ if ( TA ){
if ( TAInfo && is_user_alive(victim) ){ if ( TAInfo && is_user_alive(victim) ){
new attacker_name[32] new attacker_name[MAX_NAME_LENGTH]
get_user_name(attacker,attacker_name,31) get_user_name(attacker,attacker_name,31)
client_print(0,print_chat,"%L",LANG_PLAYER,"TA_MSG",attacker_name) 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)) if (!is_user_connected(killer) || !is_user_connected(victim))
return PLUGIN_CONTINUE return PLUGIN_CONTINUE
new killer_name[32] new killer_name[MAX_NAME_LENGTH]
get_user_name(killer,killer_name,31) 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 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 headshot = ( hitplace == HIT_HEAD ) ? 1:0
new selfKill = ( killer == victim ) ? 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) get_user_name(victim,victim_name,31)
new Float:statstime = get_cvar_float("dodstats_statstime") 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) 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) if ( !enemygre ) ShowSyncHudMsg(0, g_center1_sync,"%L",LANG_PLAYER,g_SHeMessages[ random_num(0,3) ],victim_name)
else 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center1_sync, "%L",i,"NADE_FAILED",victim_name) 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 ( (a >>= 1) > 6 ) a = 6
if ( KillingStreak ){ if ( KillingStreak ){
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_left_sync, "%L",i,g_KillingMsg[ a ], killer_name) 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) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
@ -693,7 +691,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK)
if ( enemygre ){ if ( enemygre ){
if ( EnemyGreKill ){ if ( EnemyGreKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center1_sync, "%L",LANG_PLAYER,"NADE_MASTER",killer_name) 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 ){ else if ( GrenadeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center1_sync, "%L",i,g_HeMessages[ random_num(0,3)],killer_name,victim_name) ShowSyncHudMsg(i, g_center1_sync, "%L",i,g_HeMessages[ random_num(0,3)],killer_name,victim_name)
@ -733,7 +731,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK)
if ( wpnindex == DODW_MORTAR && MortarKill ){ if ( wpnindex == DODW_MORTAR && MortarKill ){
set_hudmessage(100, 100, 255, -1.0, 0.19, 0, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center2_sync, "%L",i,mortarmsg[random_num(0,1)],killer_name,victim_name) 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 new pos = g_KillCount - 2
if ( pos > 2 ) pos = 2 if ( pos > 2 ) pos = 2
if ( DoubleKill ) { if ( DoubleKill ) {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(g_prevKillerId,name,31) get_user_name(g_prevKillerId,name,31)
if ( pos == 2 ){ if ( pos == 2 ){
new kills[3] new kills[3]
num_to_str(g_KillCount,kills,2) 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) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
show_hudmessage(i,"%L",i,g_DoubleKillMsg[pos],name,g_KillCount) show_hudmessage(i,"%L",i,g_DoubleKillMsg[pos],name,g_KillCount)
@ -788,11 +786,11 @@ public checkKills(param[]){
a -= 3 a -= 3
if ( a > -1 ){ if ( a > -1 ){
if ( MultiKill ) { if ( MultiKill ) {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id,name,31) 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) set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, -1)
if ( a > 6 ) a = 6 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_left_sync, "%L",i,g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1]) 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 LeaderScore
new NumOfLeaders new NumOfLeaders
new LeaderID new LeaderID
new PScore[33] new PScore[MAX_PLAYERS]
public client_disconnect(id) { public client_disconnect(id) {
if ( !LeadSounds || isDSMActive() ) return PLUGIN_CONTINUE if ( !LeadSounds || isDSMActive() ) return PLUGIN_CONTINUE
@ -820,7 +818,7 @@ public client_disconnect(id) {
PScore[id] = 0 PScore[id] = 0
if ( NumOfLeaders == 0 ){ if ( NumOfLeaders == 0 ){
LeaderScore = 0 LeaderScore = 0
for ( new i=1; i<33; i++ ) for ( new i=1; i<MAX_PLAYERS; i++ )
if ( PScore[i] > LeaderScore ){ if ( PScore[i] > LeaderScore ){
@ -836,7 +834,7 @@ public client_disconnect(id) {
else if ( NumOfLeaders == 1 ) else if ( NumOfLeaders == 1 )
client_cmd( LeaderID,"spk misc/takenlead" ) client_cmd( LeaderID,"spk misc/takenlead" )
else if ( NumOfLeaders > 1 ) else if ( NumOfLeaders > 1 )
for ( new i=1; i<33; i++ ) for ( new i=1; i<=MaxClients; i++ )
if ( PScore[i] == LeaderScore ) if ( PScore[i] == LeaderScore )
client_cmd( i,"spk misc/tiedlead") client_cmd( i,"spk misc/tiedlead")
//else no players on server or have 0 score //else no players on server or have 0 score
@ -847,7 +845,7 @@ public client_disconnect(id) {
client_cmd( LeaderID,"spk misc/takenlead" ) client_cmd( LeaderID,"spk misc/takenlead" )
} }
else { else {
for ( new i=1; i<33; i++ ) for ( new i=1; i<MAX_PLAYERS; i++ )
if ( PScore[i] == LeaderScore ) client_cmd( i,"spk misc/takenlead" ) if ( PScore[i] == LeaderScore ) client_cmd( i,"spk misc/takenlead" )
} }
} }
@ -872,13 +870,13 @@ public get_score(){
} }
else if ( NumOfLeaders > 1 ){ else if ( NumOfLeaders > 1 ){
for ( new i=1; i<33; i++ ) for ( new i=1; i<MAX_PLAYERS; i++ )
if ( PScore[i] == LeaderScore && i != PlayerID ) if ( PScore[i] == LeaderScore && i != PlayerID )
client_cmd( i,"spk misc/lostlead" ) client_cmd( i,"spk misc/lostlead" )
client_cmd( PlayerID,"spk misc/takenlead" ) client_cmd( PlayerID,"spk misc/takenlead" )
} }
else if ( NumOfLeaders == 0 ){ // start else if ( NumOfLeaders == 0 ){ // start
for ( new i=1; i<33; i++ ) for ( new i=1; i<MAX_PLAYERS; i++ )
if ( i != PlayerID && is_user_connected(i) ) client_cmd( i,"spk misc/lostlead" ) if ( i != PlayerID && is_user_connected(i) ) client_cmd( i,"spk misc/lostlead" )
client_cmd( PlayerID,"spk misc/takenlead" ) client_cmd( PlayerID,"spk misc/takenlead" )
} }
@ -913,7 +911,7 @@ public cmdStatsMe(id){
} }
displayStats_steam(id,dest) { displayStats_steam(id,dest) {
new name[32], stats[9], body[8] new name[MAX_NAME_LENGTH], stats[9], body[8]
get_user_wstats(id,0,stats,body) get_user_wstats(id,0,stats,body)
new pos = copy(g_Buffer,2047,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px; color:#FFB000;}</style></head><pre><body>") new pos = copy(g_Buffer,2047,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px; color:#FFB000;}</style></head><pre><body>")
@ -952,7 +950,7 @@ public cmdRank(id){
} }
displayRank_steam(id,dest) { 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 rank_pos = get_user_stats(id,stats,body)
new pos = copy(g_Buffer,2047,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>") new pos = copy(g_Buffer,2047,"<html><head><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>")
@ -991,7 +989,7 @@ public cmdTop15(id) {
/* get top 15 */ /* get top 15 */
getTop15_steam(id){ 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,"<html><head><meta charset=utf-8><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>") new pos = copy(g_Buffer,2047,"<html><head><meta charset=utf-8><style type=^"text/css^">pre{color:#FFB000;}body{background:Black;margin-left:8px;margin-top:0px;color:#FFB000;}</style></head><pre><body>")

View File

@ -8,8 +8,8 @@
#include <amxmodx> #include <amxmodx>
#include <dodx> #include <dodx>
new g_pingSum[33] new g_pingSum[MAX_PLAYERS]
new g_pingCount[33] new g_pingCount[MAX_PLAYERS]
public plugin_init() public plugin_init()
register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team") register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@ -17,7 +17,7 @@ public plugin_init()
public client_disconnect(id) { public client_disconnect(id) {
if ( is_user_bot( id ) || !is_user_connected(id) || !isDSMActive() ) return PLUGIN_CONTINUE if ( is_user_bot( id ) || !is_user_connected(id) || !isDSMActive() ) return PLUGIN_CONTINUE
remove_task( id ) 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 ) new iUserid = get_user_userid( id )
get_user_info(id,"team", szTeam, 15 ) get_user_info(id,"team", szTeam, 15 )
szTeam[0] -= 32; szTeam[0] -= 32;

View File

@ -32,7 +32,7 @@
#define MAX_PLAYERS 33 /* Maximum number of players AMX Mod X supports */ #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 */ #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 stock const MaxClients; /* Maximum number of players the server supports (dynamic) */
#define M_PI 3.1415926535 #define M_PI 3.1415926535

View File

@ -111,7 +111,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
if ((get_user_flags(player) & ADMIN_IMMUNITY) && if ((get_user_flags(player) & ADMIN_IMMUNITY) &&
((flags & CMDTARGET_ALLOW_SELF) ? (id != player) : true) ) ((flags & CMDTARGET_ALLOW_SELF) ? (id != player) : true) )
{ {
new imname[32]; new imname[MAX_NAME_LENGTH];
get_user_name(player,imname,31); get_user_name(player,imname,31);
console_print(id,"%L",id,"CLIENT_IMM",imname); console_print(id,"%L",id,"CLIENT_IMM",imname);
return 0; return 0;
@ -121,7 +121,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
{ {
if (!is_user_alive(player)) if (!is_user_alive(player))
{ {
new imname[32]; new imname[MAX_NAME_LENGTH];
get_user_name(player,imname,31); get_user_name(player,imname,31);
console_print(id,"%L",id,"CANT_PERF_DEAD",imname); console_print(id,"%L",id,"CANT_PERF_DEAD",imname);
return 0; return 0;
@ -131,7 +131,7 @@ stock cmd_target(id,const arg[],flags = CMDTARGET_OBEY_IMMUNITY)
{ {
if (is_user_bot(player)) if (is_user_bot(player))
{ {
new imname[32]; new imname[MAX_NAME_LENGTH];
get_user_name(player,imname,31); get_user_name(player,imname,31);
console_print(id,"%L",id,"CANT_PERF_BOT",imname); console_print(id,"%L",id,"CANT_PERF_BOT",imname);
return 0; 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 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)) 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 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)) 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 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)) if (is_user_connected(i))
{ {
@ -350,12 +343,10 @@ stock show_activity_key(const KeyWithoutName[], const KeyWithName[], const ___Ad
new keyfmt[256]; new keyfmt[256];
new i; new i;
new __maxclients=get_maxplayers();
switch( get_pcvar_num(__amx_show_activity) ) switch( get_pcvar_num(__amx_show_activity) )
{ {
case 5: // hide name to admins, display nothing to normal players case 5: // hide name to admins, display nothing to normal players
while (i++ < __maxclients) while (i++ < MaxClients)
{ {
if ( is_user_connected(i) ) 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 case 4: // show name only to admins, display nothing to normal players
while (i++ < __maxclients) while (i++ < MaxClients)
{ {
if ( is_user_connected(i) ) 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 case 3: // show name only to admins, hide name from normal users
while (i++ < __maxclients) while (i++ < MaxClients)
{ {
if ( is_user_connected(i) ) 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 case 2: // show name to all users
while (i++ < __maxclients) while (i++ < MaxClients)
{ {
if ( is_user_connected(i) ) 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 case 1: // hide name from all users
while (i++ < __maxclients) while (i++ < MaxClients)
{ {
if ( is_user_connected(i) ) if ( is_user_connected(i) )
{ {

View File

@ -884,7 +884,7 @@
{ {
new maxplayers = get_cvar_num("sv_visiblemaxplayers"); new maxplayers = get_cvar_num("sv_visiblemaxplayers");
if (maxplayers <= 0) if (maxplayers <= 0)
maxplayers = get_maxplayers(); maxplayers = MaxClients;
return (get_playersnum(1) <= maxplayers-num) ? true : false; return (get_playersnum(1) <= maxplayers-num) ? true : false;
} }

View File

@ -125,7 +125,7 @@ public countVote(id, key)
{ {
if (get_cvar_float("amx_vote_answers")) if (get_cvar_float("amx_vote_answers"))
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, 31) get_user_name(id, name, 31)
if (key == SELECTMAPS) if (key == SELECTMAPS)

View File

@ -37,12 +37,12 @@
new Array:g_mapName; new Array:g_mapName;
new g_mapNums new g_mapNums
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_voteCount[5] new g_voteCount[5]
new g_voteSelected[33][4] new g_voteSelected[MAX_PLAYERS][4]
new g_voteSelectedNum[33] new g_voteSelectedNum[MAX_PLAYERS]
new g_coloredMenus new g_coloredMenus
@ -190,7 +190,7 @@ public voteCount(id, key)
if (get_cvar_float("amx_vote_answers")) if (get_cvar_float("amx_vote_answers"))
{ {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, 31) get_user_name(id, name, 31)
client_print(0, print_chat, "%L", LANG_PLAYER, "X_VOTED_FOR", name, key + 1) client_print(0, print_chat, "%L", LANG_PLAYER, "X_VOTED_FOR", name, key + 1)
@ -388,7 +388,7 @@ public actionVoteMapMenu(id, key)
keys |= MENU_KEY_0 keys |= MENU_KEY_0
show_menu(id, keys, menuBody, iVoteTime, menuName) 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_authid(id, authid, 31)
get_user_name(id, name, 31) get_user_name(id, name, 31)
@ -466,7 +466,7 @@ public actionMapsMenu(id, key)
message_end() message_end()
} }
new authid[32], name[32] new authid[32], name[MAX_NAME_LENGTH]
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
get_user_name(id, name, 31) get_user_name(id, name, 31)

View File

@ -41,7 +41,7 @@
#define MENUITEMSPERPAGE 8 #define MENUITEMSPERPAGE 8
//#define MENUS_NUMBER 16 //#define MENUS_NUMBER 16
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menusNumber = 0 new g_menusNumber = 0
new g_menuBody[MAXMENUS][STRINGSIZE] new g_menuBody[MAXMENUS][STRINGSIZE]
new bool:g_menuBodyPhrase[MAXMENUS] new bool:g_menuBodyPhrase[MAXMENUS]
@ -51,7 +51,7 @@ new g_menuPlugin[MAXMENUS][STRINGSIZE]
new g_coloredMenus new g_coloredMenus
new g_clientMenuPosition[33] new g_clientMenuPosition[MAX_PLAYERS]
new g_clientMenusNumber = 0 new g_clientMenusNumber = 0
new g_clientMenuBody[MAXMENUS][STRINGSIZE] new g_clientMenuBody[MAXMENUS][STRINGSIZE]
new bool:g_clientMenuBodyPhrase[MAXMENUS] new bool:g_clientMenuBodyPhrase[MAXMENUS]

View File

@ -36,7 +36,7 @@
#define DISPLAY_MSG // Comment to disable message on join #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_serverLang
new g_langNum new g_langNum
new g_coloredMenus new g_coloredMenus

View File

@ -39,18 +39,16 @@
#define CHECK_FREQ 5 // This is also the warning message frequency. #define CHECK_FREQ 5 // This is also the warning message frequency.
#define CLASS_GESTATE 9 #define CLASS_GESTATE 9
new g_oldangles[33][3] new g_oldangles[MAX_PLAYERS][3]
new g_idletime[33] new g_idletime[MAX_PLAYERS]
new bool:g_spawned[33] = {true, ...} new bool:g_spawned[MAX_PLAYERS] = {true, ...}
new g_class[33] // stored info from the "ScoreInfo" message new g_class[MAX_PLAYERS] // stored info from the "ScoreInfo" message
new mp_tournamentmode; new mp_tournamentmode;
new amx_idle_time; new amx_idle_time;
new amx_idle_min_players; new amx_idle_min_players;
new amx_idle_ignore_immunity; new amx_idle_ignore_immunity;
new maxplayers;
public plugin_init() { public plugin_init() {
register_plugin("Idle Player Remover",AMXX_VERSION_STR,"AMXX Dev Team") register_plugin("Idle Player Remover",AMXX_VERSION_STR,"AMXX Dev Team")
@ -71,15 +69,12 @@ public plugin_init() {
{ {
register_event("ScoreInfo","msgScoreInfo","a") register_event("ScoreInfo","msgScoreInfo","a")
} }
maxplayers=get_maxplayers();
} }
public checkPlayers() { public checkPlayers() {
if (get_pcvar_num(mp_tournamentmode)) return PLUGIN_HANDLED 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 (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 ( !get_pcvar_num(amx_idle_ignore_immunity) ) {
if ( access(i, ADMIN_IMMUNITY) ) continue if ( access(i, ADMIN_IMMUNITY) ) continue
@ -116,7 +111,7 @@ check_idletime(id) {
new timeleft = maxidletime - g_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) 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) { } else if (g_idletime[id] > maxidletime) {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id, name, 31) get_user_name(id, name, 31)
client_print(0, print_chat, "[AMXX] %s was kicked for being idle longer than %d seconds", name, maxidletime) 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) log_amx("%s was kicked for being idle longer than %d seconds", name, maxidletime)

View File

@ -71,8 +71,8 @@ enum {
}; };
new g_Class[33]; // stored info from the "ScoreInfo" message new g_Class[MAX_PLAYERS]; // stored info from the "ScoreInfo" message
new g_Team[33]; new g_Team[MAX_PLAYERS];
new g_ScoreInfo_Class; new g_ScoreInfo_Class;
new g_ScoreInfo_Team; new g_ScoreInfo_Team;
@ -102,7 +102,7 @@ public plugin_init() {
// clear class info.. // clear class info..
new i=0; new i=0;
while (i<33) { while (i<MAX_PLAYERS) {
g_Class[i]=0; g_Class[i]=0;
g_Team[i]=-1; g_Team[i]=-1;
i++; i++;
@ -152,7 +152,7 @@ stock UTIL_FindCommander() {
} }
stock UTIL_IsSpectator(id) { stock UTIL_IsSpectator(id) {
if (id<1||id>get_maxplayers()) if (id<1||id>MaxClients)
return -1; return -1;
if (g_Class[id]==PLAYERCLASS_SPECTATOR) if (g_Class[id]==PLAYERCLASS_SPECTATOR)
return 1; return 1;
@ -167,7 +167,7 @@ public cmdRandom(id,level,cid) {
read_argv(1,arg,31) read_argv(1,arg,31)
new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
if (!player) return PLUGIN_HANDLED 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]; new auth[32],auth_targ[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_name(player,name_targ,31); get_user_name(player,name_targ,31);
@ -182,7 +182,7 @@ public cmdRandom(id,level,cid) {
else { else {
new cur=0; new cur=0;
new i=1; new i=1;
while (i<get_maxplayers()) { while (i<MaxClients) {
if (is_user_connected(i)) { if (is_user_connected(i)) {
if (!(get_user_flags(i) & ADMIN_IMMUNITY)) { if (!(get_user_flags(i) & ADMIN_IMMUNITY)) {
if (g_Team[i] == 0) { if (g_Team[i] == 0) {
@ -193,7 +193,7 @@ public cmdRandom(id,level,cid) {
i++; i++;
} }
if (cur) { if (cur) {
new name[32],auth[32]; new name[MAX_NAME_LENGTH],auth[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_authid(id,auth,31); get_user_authid(id,auth,31);
log_amx("Cmd: ^"%s<%d><%s><>^" random all",name,get_user_userid(id),auth); log_amx("Cmd: ^"%s<%d><%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)) { if (g_Team[index] == 0 && !(get_user_flags(index) & ADMIN_IMMUNITY)) {
client_cmd(index, "%s", g_AutoAssignAck); client_cmd(index, "%s", g_AutoAssignAck);
} }
if (++index > get_maxplayers()) { if (++index >= MaxClients) {
return PLUGIN_HANDLED_MAIN return PLUGIN_HANDLED_MAIN
} }
} }
@ -233,7 +233,7 @@ public cmdReadyRoom(id,level,cid) {
read_argv(1,arg,31) read_argv(1,arg,31)
new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF) new player = cmd_target(id,arg,CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
if (!player) return PLUGIN_HANDLED 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]; new auth[32],auth_targ[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_name(player,name_targ,31); get_user_name(player,name_targ,31);
@ -248,7 +248,7 @@ public cmdReadyRoom(id,level,cid) {
else { else {
new cur=0; new cur=0;
new i=1; new i=1;
while (i<get_maxplayers()) { while (i<=MaxClients) {
if (is_user_connected(i)) { if (is_user_connected(i)) {
if (UTIL_IsSpectator(i) == 1 || g_Team[i] != 0) { if (UTIL_IsSpectator(i) == 1 || g_Team[i] != 0) {
cur++; cur++;
@ -257,7 +257,7 @@ public cmdReadyRoom(id,level,cid) {
i++; i++;
} }
if (cur) { if (cur) {
new name[32],auth[32]; new name[MAX_NAME_LENGTH],auth[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_authid(id,auth,31); get_user_authid(id,auth,31);
log_amx("Cmd: ^"%s<%d><%s><>^" ready room all",name,get_user_userid(id),auth); log_amx("Cmd: ^"%s<%d><%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) { if (is_user_connected(index) && g_Team[index]!=0) {
client_cmd(index, "%s", g_ReadyRoomAck) client_cmd(index, "%s", g_ReadyRoomAck)
} }
if (++index > get_maxplayers()) { if (++index >= MaxClients) {
return PLUGIN_HANDLED_MAIN 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."); client_print(id,print_chat,"[AMXX] That user is already on team two.");
return PLUGIN_HANDLED_MAIN; 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]; new auth[32],auth_targ[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_name(player,name_targ,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."); client_print(id,print_chat,"[AMXX] That user is already on team one.");
return PLUGIN_HANDLED_MAIN; 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]; new auth[32],auth_targ[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_name(player,name_targ,31); get_user_name(player,name_targ,31);
@ -350,9 +350,9 @@ public cmdUnComm(id,level,cid) {
if (!cmd_access(id,level,cid,1)) if (!cmd_access(id,level,cid,1))
return PLUGIN_HANDLED return PLUGIN_HANDLED
new comm = UTIL_FindCommander(); new comm = UTIL_FindCommander();
if (comm>0&&comm<=get_maxplayers()) { if (comm>0&&comm<=MaxClients) {
client_cmd(comm, "%s", g_StopCommAck); 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]; new auth[32],auth_targ[32];
get_user_name(id,name,31); get_user_name(id,name,31);
get_user_name(comm,name_targ,31); get_user_name(comm,name_targ,31);

View File

@ -36,14 +36,14 @@
#include <amxmisc> #include <amxmisc>
#include <ns> #include <ns>
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[33][32] new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[33] new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[33] new g_menuOption[MAX_PLAYERS]
new g_menuSettings[33] new g_menuSettings[MAX_PLAYERS]
new g_menuSelect[33][64] new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[33] new g_menuSelectNum[MAX_PLAYERS]
#define MAX_CLCMDS 24 #define MAX_CLCMDS 24
@ -325,7 +325,7 @@ public actionBanMenu(id, key)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
@ -338,8 +338,7 @@ public actionBanMenu(id, key)
if ( !banTime ) // permanent if ( !banTime ) // permanent
{ {
new maxpl = get_maxplayers(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxpl; i++)
{ {
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM"); 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]; new tempTime[32];
formatex(tempTime,sizeof(tempTime)-1,"%d",banTime); formatex(tempTime,sizeof(tempTime)-1,"%d",banTime);
new maxpl = get_maxplayers(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxpl; i++)
{ {
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime); 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 menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -491,7 +489,7 @@ public actionSlapMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32] new name2[MAX_NAME_LENGTH]
get_user_name(player, name2, 31) get_user_name(player, name2, 31)
@ -502,7 +500,7 @@ public actionSlapMenu(id, key)
return PLUGIN_HANDLED 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(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -541,7 +539,7 @@ displaySlapMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32], team[4] new name[MAX_NAME_LENGTH], team[4]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -624,7 +622,7 @@ public actionKickMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key] 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(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -658,7 +656,7 @@ displayKickMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 8 new start = pos * 8
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -728,7 +726,7 @@ public actionTeamMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
@ -762,7 +760,7 @@ displayTeamMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i, iteam new i, iteam
new name[32], team[4] new name[MAX_NAME_LENGTH], team[4]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -843,7 +841,7 @@ public actionClcmdMenu(id, key)
if (is_user_connected(player)) 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]]]) copy(command, 63, g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player, authid, 31) get_user_authid(player, authid, 31)
@ -882,7 +880,7 @@ displayClcmdMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])

View File

@ -38,7 +38,7 @@
#define MAX_ATTEMPTS 128 // How many times to search in an area for a free space #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 #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; new amx_unstuck_frequency;

View File

@ -42,7 +42,7 @@
#define MAX_SYSTEM 32 #define MAX_SYSTEM 32
new g_menuPos[33] new g_menuPos[MAX_PLAYERS]
new g_fileToSave[64] new g_fileToSave[64]
new g_coloredMenus new g_coloredMenus
new g_Modified new g_Modified

View File

@ -40,14 +40,14 @@
#include <cstrike> #include <cstrike>
#include <fakemeta> #include <fakemeta>
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[33][32] new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[33] new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[33] new g_menuOption[MAX_PLAYERS]
new g_menuSettings[33] new g_menuSettings[MAX_PLAYERS]
new g_menuSelect[33][64] new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[33] new g_menuSelectNum[MAX_PLAYERS]
#define MAX_CLCMDS 24 #define MAX_CLCMDS 24
@ -79,7 +79,7 @@ new g_CSTeamiNumbers[3] = {
3 3
} }
new g_CSPlayerCanSwitchFromSpec[33] new g_CSPlayerCanSwitchFromSpec[MAX_PLAYERS]
new g_transferingAdmin new g_transferingAdmin
new allow_spectators, mp_limitteams new allow_spectators, mp_limitteams
@ -273,7 +273,7 @@ public actionBanMenu(id, key)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
@ -286,8 +286,7 @@ public actionBanMenu(id, key)
if ( !banTime ) // permanent if ( !banTime ) // permanent
{ {
new maxpl = get_maxplayers(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxpl; i++)
{ {
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "PERM"); 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]; new tempTime[32];
formatex(tempTime,sizeof(tempTime)-1,"%d",banTime); formatex(tempTime,sizeof(tempTime)-1,"%d",banTime);
new maxpl = get_maxplayers(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxpl; i++)
{ {
show_activity_id(i, id, name, "%L %s %L", i, "BAN", name2, i, "FOR_MIN", tempTime); 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 menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -442,7 +440,7 @@ public actionSlapMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32] new name2[MAX_NAME_LENGTH]
get_user_name(player, name2, 31) get_user_name(player, name2, 31)
@ -453,7 +451,7 @@ public actionSlapMenu(id, key)
return PLUGIN_HANDLED 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(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -492,7 +490,7 @@ displaySlapMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32], team[4] new name[MAX_NAME_LENGTH], team[4]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -592,7 +590,7 @@ public actionKickMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key] 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(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -626,7 +624,7 @@ displayKickMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 8 new start = pos * 8
if (start >= g_menuPlayersNum[id]) 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)) ) 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)) get_user_name(id, name, charsmax(name))
client_print(g_transferingAdmin, print_chat, "%L", g_transferingAdmin, "CANT_PERF_PLAYER", 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 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
@ -838,7 +836,7 @@ displayTeamMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i, iteam new i, iteam
new name[32], team[4] new name[MAX_NAME_LENGTH], team[4]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -947,7 +945,7 @@ public actionClcmdMenu(id, key)
if (is_user_connected(player)) 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]]]) copy(command, charsmax(command), g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player, authid, 31) get_user_authid(player, authid, 31)
@ -986,7 +984,7 @@ displayClcmdMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])

View File

@ -40,25 +40,25 @@ new DisabledCallback;
new EnabledCallback; new EnabledCallback;
// pcvar that the client is currently modifying // pcvar that the client is currently modifying
new CurrentCvar[33]; new CurrentCvar[MAX_PLAYERS];
// Name of the cvar being modified // Name of the cvar being modified
new CurrentCvarName[33][32]; new CurrentCvarName[MAX_PLAYERS][32];
// Plugin ID that the client is modifying // Plugin ID that the client is modifying
new CurrentPlid[33]; new CurrentPlid[MAX_PLAYERS];
// Page that the client is currently on // Page that the client is currently on
new CurrentPage[33]; new CurrentPage[MAX_PLAYERS];
// Menu function ID that the client is in // 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 cvarmenu_cmdid;
new cmdmenu_cmdid; new cmdmenu_cmdid;
new ExplicitPlugin[33]; new ExplicitPlugin[MAX_PLAYERS];
public plugin_init() public plugin_init()
{ {
@ -431,7 +431,7 @@ public CommandChangeCvar(id)
// Copy of admincmd's global output. // Copy of admincmd's global output.
new Name[32]; new Name[MAX_NAME_LENGTH];
new AuthID[40]; new AuthID[40];
get_user_name(id,Name,sizeof(Name)-1); get_user_name(id,Name,sizeof(Name)-1);
@ -441,8 +441,7 @@ public CommandChangeCvar(id)
new cvar_val[64]; new cvar_val[64];
new maxpl = get_maxplayers(); for (new i = 1; i <= MaxClients; i++)
for (new i = 1; i <= maxpl; i++)
{ {
if (is_user_connected(i) && !is_user_bot(i)) if (is_user_connected(i) && !is_user_bot(i))
{ {

View File

@ -41,7 +41,7 @@ new g_menuData[MAX_MENU_DATA][32]
new g_menuDataVar[MAX_MENU_DATA][32] new g_menuDataVar[MAX_MENU_DATA][32]
new g_menuDataId[MAX_MENU_DATA] new g_menuDataId[MAX_MENU_DATA]
new g_menuDataNum new g_menuDataNum
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_fileToSave[64] new g_fileToSave[64]
new bool:g_modified new bool:g_modified
new g_coloredMenus new g_coloredMenus

View File

@ -36,7 +36,6 @@
#include <amxmisc> #include <amxmisc>
#include <fakemeta> #include <fakemeta>
#define MAX_PLAYERS 32 + 1
new g_menuPosition[MAX_PLAYERS] new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[MAX_PLAYERS][32] new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[MAX_PLAYERS] new g_menuPlayersNum[MAX_PLAYERS]
@ -89,7 +88,7 @@ public actionTelMenu(id, key)
default: default:
{ {
new player = g_menuPlayers[id][g_menuPosition[id] * 6 + key] 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)) get_user_name(player, name2, charsmax(name2))
@ -138,7 +137,7 @@ public actionTelMenu(id, key)
doTeleport(player, origin, vAngle) 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(id, authid, charsmax(authid))
get_user_authid(player, authid2, charsmax(authid2)) get_user_authid(player, authid2, charsmax(authid2))
@ -178,7 +177,7 @@ displayTelMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 6 new start = pos * 6
new bool:blockMenu = (is_user_alive(id) && g_menuOption[id] < 1) ? true : false new bool:blockMenu = (is_user_alive(id) && g_menuOption[id] < 1) ? true : false

View File

@ -36,14 +36,14 @@
#include <amxmisc> #include <amxmisc>
#include <tfcx> #include <tfcx>
new g_menuPosition[33] new g_menuPosition[MAX_PLAYERS]
new g_menuPlayers[33][32] new g_menuPlayers[MAX_PLAYERS][32]
new g_menuPlayersNum[33] new g_menuPlayersNum[MAX_PLAYERS]
new g_menuOption[33] new g_menuOption[MAX_PLAYERS]
new g_menuSettings[33] new g_menuSettings[MAX_PLAYERS]
new g_menuSelect[33][64] new g_menuSelect[MAX_PLAYERS][64]
new g_menuSelectNum[33] new g_menuSelectNum[MAX_PLAYERS]
#define MAX_CLCMDS 24 #define MAX_CLCMDS 24
@ -138,7 +138,7 @@ public actionBanMenu(id, key)
} }
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + 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_name(player, name2, 31)
get_user_authid(id, authid, 31) get_user_authid(id, authid, 31)
get_user_authid(player, authid2, 31) get_user_authid(player, authid2, 31)
@ -215,7 +215,7 @@ displayBanMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -298,7 +298,7 @@ public actionSlapMenu(id,key) {
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new name2[32] new name2[MAX_NAME_LENGTH]
get_user_name(player,name2,31) get_user_name(player,name2,31)
if (!is_user_alive(player)) { if (!is_user_alive(player)) {
@ -307,7 +307,7 @@ public actionSlapMenu(id,key) {
return PLUGIN_HANDLED 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(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
@ -351,7 +351,7 @@ displaySlapMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -427,7 +427,7 @@ public actionKickMenu(id,key)
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 8 + key] 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(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
get_user_name(id,name,31) get_user_name(id,name,31)
@ -461,7 +461,7 @@ displayKickMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 8 new start = pos * 8
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -530,7 +530,7 @@ public actionTeamMenu(id,key) {
case 9: displayTeamMenu(id,--g_menuPosition[id]) case 9: displayTeamMenu(id,--g_menuPosition[id])
default: { default: {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] 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_name(player,name2,31)
get_user_authid(id,authid,31) get_user_authid(id,authid,31)
get_user_authid(player,authid2,31) get_user_authid(player,authid2,31)
@ -570,7 +570,7 @@ displayTeamMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i, iteam new i, iteam
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])
@ -647,7 +647,7 @@ public actionClcmdMenu(id,key) {
new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key] new player = g_menuPlayers[id][g_menuPosition[id] * 7 + key]
new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1] new flags = g_clcmdMisc[g_menuSelect[id][g_menuOption[id]]][1]
if (is_user_connected(player)) { 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]]]) copy(command,63,g_clcmdCmd[g_menuSelect[id][g_menuOption[id]]])
get_user_authid(player,authid,31) get_user_authid(player,authid,31)
get_user_name(player,name,31) get_user_name(player,name,31)
@ -680,7 +680,7 @@ displayClcmdMenu(id, pos)
new menuBody[512] new menuBody[512]
new b = 0 new b = 0
new i new i
new name[32] new name[MAX_NAME_LENGTH]
new start = pos * 7 new start = pos * 7
if (start >= g_menuPlayersNum[id]) if (start >= g_menuPlayersNum[id])

View File

@ -47,20 +47,20 @@ public DoubleKill
public DoubleKillSound public DoubleKillSound
public BulletDamage public BulletDamage
new g_streakKills[33][2] new g_streakKills[MAX_PLAYERS][2]
new g_multiKills[33][2] new g_multiKills[MAX_PLAYERS][2]
new Float:g_prevKill new Float:g_prevKill
new g_prevKillerId new g_prevKillerId
new g_KillCount; new g_KillCount;
new g_userPosition[33] new g_userPosition[MAX_PLAYERS]
new g_userState[33] new g_userState[MAX_PLAYERS]
new g_userPlayers[33][32] new g_userPlayers[MAX_PLAYERS][32]
new g_Buffer[2048] new g_Buffer[2048]
new g_Killers[33][4] new g_Killers[MAX_PLAYERS][4]
new Float:g_DeathStats[33] new Float:g_DeathStats[MAX_PLAYERS]
new g_center1_sync new g_center1_sync
new g_center2_sync new g_center2_sync
@ -240,7 +240,7 @@ public cmdRank(id){
} }
displayRank(id,dest) { 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 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", 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]) stats[0],stats[1],stats[3],stats[6],stats[5],stats[4])
@ -264,7 +264,7 @@ public cmdTop15(id) {
/* get top 15 */ /* get top 15 */
getTop15(){ 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 pos = copy(g_Buffer,2047,"# nick kills/deaths TKs hits/shots/headshots^n")
new imax = get_statsnum() new imax = get_statsnum()
if (imax > 15) imax = 15 if (imax > 15) imax = 15
@ -310,10 +310,9 @@ public cmdStats(id){
/* build list of attackers */ /* build list of attackers */
getAttackers(id) { 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 pos = copy(g_Buffer,2047,"Attackers:^n")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_astats(id,a,stats,body,wpn,31)){ if(get_user_astats(id,a,stats,body,wpn,31)){
found = 1 found = 1
@ -331,10 +330,9 @@ getAttackers(id) {
/* build list of victims */ /* build list of victims */
getVictims(id) { 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 pos = copy(g_Buffer,2047,"Victims:^n")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_vstats(id,a,stats,body,wpn,31)){ if(get_user_vstats(id,a,stats,body,wpn,31)){
found = 1 found = 1
if (stats[1]) if (stats[1])
@ -361,7 +359,7 @@ getHits(id,killer) {
/* build list of hits for say hp */ /* build list of hits for say hp */
getMyHits(id,killed) { 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) get_user_name(killed,name,31)
new pos = format(g_Buffer,2047,"You hit %s in:",name) new pos = format(g_Buffer,2047,"You hit %s in:",name)
get_user_vstats(id,killed,stats,body) get_user_vstats(id,killed,stats,body)
@ -384,7 +382,7 @@ public cmdKiller(id) {
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if (g_Killers[id][0]) { 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_name(g_Killers[id][0],name,31)
get_user_astats(id,g_Killers[id][0],stats,body,wpn,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 ) 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 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 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 if (end > inum) end = inum
for(new a = start; a < end; ++a){ for(new a = start; a < end; ++a){
get_user_name(g_userPlayers[id][a],name,31) 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 */ /* save state at death */
public client_death(killer,victim,wpnindex,hitplace,TK){ 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) get_user_name(killer,killer_name,31)
if ( KillingStreak || KillingStreakSound ){ if ( KillingStreak || KillingStreakSound ){
@ -486,7 +484,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
new headshot = ( hitplace == HIT_HEAD ) ? 1:0 new headshot = ( hitplace == HIT_HEAD ) ? 1:0
new selfKill = ( killer == victim ) ? 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) get_user_name(victim,victim_name,31)
new Float:statstime = get_cvar_float("tfcstats_statstime") 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 ( (a >>= 1) > 6 ) a = 6
if ( KillingStreak ){ if ( KillingStreak ){
set_hudmessage(0, 100, 255, 0.05, 0.55, 2, 0.02, 6.0, 0.01, 0.1, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_left_sync, g_KillingMsg[ a ], killer_name) 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 ( xmod_is_melee_wpn(wpnindex) && ( KnifeKill || KnifeKillSound ) ){
if ( KnifeKill ){ if ( KnifeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
@ -584,7 +582,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
else if ( grenade ){ else if ( grenade ){
if ( GrenadeKill ){ if ( GrenadeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.15, 1, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center1_sync, g_HeMessages[ random_num(0,3)],killer_name,victim_name) 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, "$wn", weapon )
replace( message, sizeof(message)-1, "$kn", killer_name ) 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) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center2_sync, "%s", message) ShowSyncHudMsg(i, g_center2_sync, "%s", message)
@ -635,7 +633,7 @@ public showDoubleKill(){
return PLUGIN_CONTINUE return PLUGIN_CONTINUE
if ( DoubleKill ) { if ( DoubleKill ) {
new name[32],message[128] new name[MAX_NAME_LENGTH],message[128]
get_user_name(g_prevKillerId,name,31) get_user_name(g_prevKillerId,name,31)
copy( message, 127, g_DoubleKillMsg[pos] ) copy( message, 127, g_DoubleKillMsg[pos] )
replace( message, 127 , "$kn", name ) replace( message, 127 , "$kn", name )
@ -645,7 +643,7 @@ public showDoubleKill(){
replace( message, 127 , "$kk", kills ) replace( message, 127 , "$kk", kills )
} }
set_hudmessage(65, 102, 158, -1.0, 0.25, 0, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
show_hudmessage(i, "%s", message) show_hudmessage(i, "%s", message)
@ -664,11 +662,11 @@ public checkKills(param[]){
a -= 3 a -= 3
if ( a > -1 ){ if ( a > -1 ){
if ( MultiKill ) { if ( MultiKill ) {
new name[32] new name[MAX_NAME_LENGTH]
get_user_name(id,name,31) 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) set_hudmessage(255, 0, 100, 0.05, 0.65, 2, 0.02, 6.0, 0.01, 0.1, -1)
if ( a > 6 ) a = 6 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_left_sync, g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1]) ShowSyncHudMsg(i, g_left_sync, g_MultiKillMsg[a],name,g_multiKills[id][0],g_multiKills[id][1])

View File

@ -35,8 +35,8 @@
#include <amxmodx> #include <amxmodx>
#include <tfcx> #include <tfcx>
new g_pingSum[33] new g_pingSum[MAX_PLAYERS]
new g_pingCount[33] new g_pingCount[MAX_PLAYERS]
public plugin_init() public plugin_init()
register_plugin("TFC Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team") register_plugin("TFC Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@ -44,7 +44,7 @@ public plugin_init()
public client_disconnect(id) { public client_disconnect(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
remove_task( 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 iUserid = get_user_userid( id )
get_user_team(id, szTeam, 15 ) get_user_team(id, szTeam, 15 )
get_user_name(id, szName ,31 ) get_user_name(id, szName ,31 )

View File

@ -49,12 +49,12 @@ public BulletDamage
public TAInfo public TAInfo
public FragInfo public FragInfo
new g_userPosition[33] new g_userPosition[MAX_PLAYERS]
new g_userState[33] new g_userState[MAX_PLAYERS]
new g_userPlayers[33][32] new g_userPlayers[MAX_PLAYERS][32]
new g_Buffer[2048] new g_Buffer[2048]
new g_Killers[33][3] new g_Killers[MAX_PLAYERS][3]
new Float:g_DeathStats[33] new Float:g_DeathStats[MAX_PLAYERS]
new g_center1_sync new g_center1_sync
new g_damage_sync new g_damage_sync
@ -209,7 +209,7 @@ public cmdTop15(id) {
/* get top 15 */ /* get top 15 */
getTop15(){ 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 pos = copy(g_Buffer,2047,"# nick kills/deaths TKs hits/shots/headshots^n")
new imax = get_statsnum() new imax = get_statsnum()
if (imax > 15) imax = 15 if (imax > 15) imax = 15
@ -252,10 +252,9 @@ public cmdStats(id){
/* build list of attackers */ /* build list of attackers */
getAttackers(id) { 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 pos = copy(g_Buffer,2047,"Attackers:^n")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_astats(id,a,stats,body,wpn,31)){ if(get_user_astats(id,a,stats,body,wpn,31)){
found = 1 found = 1
if (stats[0]) if (stats[0])
@ -271,10 +270,9 @@ getAttackers(id) {
/* build list of victims */ /* build list of victims */
getVictims(id) { 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 pos = copy(g_Buffer,2047,"Victims:^n")
new amax = get_maxplayers() for(new a = 1; a <= MaxClients; ++a){
for(new a = 1; a <= amax; ++a){
if(get_user_vstats(id,a,stats,body,wpn,31)){ if(get_user_vstats(id,a,stats,body,wpn,31)){
found = 1 found = 1
if (stats[1]) if (stats[1])
@ -301,7 +299,7 @@ getHits(id,killer) {
/* build list of hits for say hp */ /* build list of hits for say hp */
getMyHits(id,killed) { 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) get_user_name(killed,name,31)
new pos = format(g_Buffer,2047,"You hit %s in:",name) new pos = format(g_Buffer,2047,"You hit %s in:",name)
get_user_vstats(id,killed,stats,body) get_user_vstats(id,killed,stats,body)
@ -317,7 +315,7 @@ getMyHits(id,killed) {
public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) { public client_damage(attacker,victim,damage,wpnindex,hitplace,TA) {
if ( TA ){ if ( TA ){
if ( TAInfo && is_user_alive(victim) ){ if ( TAInfo && is_user_alive(victim) ){
new attacker_name[32] new attacker_name[MAX_NAME_LENGTH]
get_user_name(attacker,attacker_name,31) get_user_name(attacker,attacker_name,31)
client_print(0,print_chat,"%s attacked a teammate",attacker_name) 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){ 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) get_user_name(killer,killer_name,31)
if ( TK ){ if ( TK ){
@ -348,7 +346,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
new grenade = ( wpnindex == TSW_M61GRENADE ) ? 1:0 new grenade = ( wpnindex == TSW_M61GRENADE ) ? 1:0
new headshot = ( hitplace == HIT_HEAD ) ? 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) get_user_name(victim,victim_name,31)
if ( killer == victim ){ if ( killer == victim ){
@ -375,7 +373,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
if ( grenade && GrenadeKill ){ if ( grenade && GrenadeKill ){
set_hudmessage(255, 100, 100, -1.0, 0.25, 1, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
show_hudmessage(i, g_HeMessages[ random_num(0,3)],killer_name,victim_name) 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 , "$wn", weapon )
replace( message, sizeof(message)-1, "$kn", killer_name ) 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) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
ShowSyncHudMsg(i, g_center1_sync, "%s", message) ShowSyncHudMsg(i, g_center1_sync, "%s", message)
@ -402,7 +400,7 @@ public client_death(killer,victim,wpnindex,hitplace,TK){
if ( killFlags & TSKF_DOUBLEKILL ){ if ( killFlags & TSKF_DOUBLEKILL ){
if ( DoubleKill ){ if ( DoubleKill ){
set_hudmessage(65, 102, 158, -1.0, 0.35, 0, 6.0, 6.0, 0.5, 0.15, -1) 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() ) if ( g_Killers[i][0] && g_DeathStats[i] > get_gametime() )
continue continue
show_hudmessage(i,"Wow! %s made a double kill !!!",killer_name) 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){ DisplayKillInfo(victim){
if ( ShowKiller ){ 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_name(g_Killers[victim][0],name,31)
get_user_astats(victim,g_Killers[victim][0],stats,body,wpn,31) get_user_astats(victim,g_Killers[victim][0],stats,body,wpn,31)
get_user_vstats(victim,g_Killers[victim][0],mstats,mbody) get_user_vstats(victim,g_Killers[victim][0],mstats,mbody)
@ -469,7 +467,7 @@ DisplayAVList(victim){
DisplayKillerHp(victim,con){ DisplayKillerHp(victim,con){
if ( KillerHp ){ if ( KillerHp ){
new name[32], kmsg[128] new name[MAX_NAME_LENGTH], kmsg[128]
get_user_name(g_Killers[victim][0],name,31) get_user_name(g_Killers[victim][0],name,31)
format(kmsg,127,"%s still has %dhp",name,g_Killers[victim][1]) format(kmsg,127,"%s still has %dhp",name,g_Killers[victim][1])
if ( con ) client_print(victim,print_console, "%s", kmsg) if ( con ) client_print(victim,print_console, "%s", kmsg)
@ -497,7 +495,7 @@ public cmdKiller(id) {
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }
if (g_Killers[id][0]) { 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_name(g_Killers[id][0],name,31)
get_user_astats(id,g_Killers[id][0],stats,body,wpn,31) get_user_astats(id,g_Killers[id][0],stats,body,wpn,31)
get_user_vstats(id,g_Killers[id][0],mstats,mbody) get_user_vstats(id,g_Killers[id][0],mstats,mbody)
@ -542,7 +540,7 @@ showStatsMenu(id,pos){
get_players(g_userPlayers[id],inum) get_players(g_userPlayers[id],inum)
if (start >= inum) start = pos = g_userPosition[id] = 0 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 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 if (end > inum) end = inum
for(new a = start; a < end; ++a){ for(new a = start; a < end; ++a){
get_user_name(g_userPlayers[id][a],name,31) get_user_name(g_userPlayers[id][a],name,31)

View File

@ -10,8 +10,8 @@
#include <tsx> #include <tsx>
#include <tsfun> #include <tsfun>
new g_pingSum[33] new g_pingSum[MAX_PLAYERS]
new g_pingCount[33] new g_pingCount[MAX_PLAYERS]
public plugin_init() public plugin_init()
register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team") register_plugin("Stats Logging",AMXX_VERSION_STR,"AMXX Dev Team")
@ -19,7 +19,7 @@ public plugin_init()
public client_disconnect(id) { public client_disconnect(id) {
if ( is_user_bot( id ) ) return PLUGIN_CONTINUE if ( is_user_bot( id ) ) return PLUGIN_CONTINUE
remove_task( id ) 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 ) new iUserid = get_user_userid( id )
// team // team