Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 35.75 KB | None | 0 0
  1. /* AMX Mod X
  2. *   Admin Commands Plugin
  3. *
  4. * by the AMX Mod X Development Team
  5. *  originally developed by OLO
  6. *
  7. * This file is part of AMX Mod X.
  8. *
  9. *
  10. *  This program is free software; you can redistribute it and/or modify it
  11. *  under the terms of the GNU General Public License as published by the
  12. *  Free Software Foundation; either version 2 of the License, or (at
  13. *  your option) any later version.
  14. *
  15. *  This program is distributed in the hope that it will be useful, but
  16. *  WITHOUT ANY WARRANTY; without even the implied warranty of
  17. *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. *  General Public License for more details.
  19. *
  20. *  You should have received a copy of the GNU General Public License
  21. *  along with this program; if not, write to the Free Software Foundation,
  22. *  Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  23. *
  24. *  In addition, as a special exception, the author gives permission to
  25. *  link the code of this program with the Half-Life Game Engine ("HL
  26. *  Engine") and Modified Game Libraries ("MODs") developed by Valve,
  27. *  L.L.C ("Valve"). You must obey the GNU General Public License in all
  28. *  respects for all of the code used other than the HL Engine and MODs
  29. *  from Valve. If you modify this file, you may extend this exception
  30. *  to your version of the file, but you are not obligated to do so. If
  31. *  you do not wish to do so, delete this exception statement from your
  32. *  version.
  33. */
  34.  
  35. #include <amxmodx>
  36. #include <amxmisc>
  37.  
  38. // This is not a dynamic array because it would be bad for 24/7 map servers.
  39. #define OLD_CONNECTION_QUEUE 10
  40.  
  41. new g_pauseCon
  42. new Float:g_pausAble
  43. new bool:g_Paused
  44. new bool:g_PauseAllowed = false
  45. new g_addCvar[] = "amx_cvar add %s"
  46.  
  47. new pausable;
  48. new rcon_password;
  49. new HandleCvarTimeLimit;
  50.  
  51. // Old connection queue
  52. new g_Names[OLD_CONNECTION_QUEUE][32];
  53. new g_SteamIDs[OLD_CONNECTION_QUEUE][32];
  54. new g_IPs[OLD_CONNECTION_QUEUE][32];
  55. new g_Access[OLD_CONNECTION_QUEUE];
  56. new g_Tracker;
  57. new g_Size;
  58.  
  59. stock InsertInfo(id)
  60. {
  61.    
  62.     // Scan to see if this entry is the last entry in the list
  63.     // If it is, then update the name and access
  64.     // If it is not, then insert it again.
  65.  
  66.     if (g_Size > 0)
  67.     {
  68.         new ip[32]
  69.         new auth[32];
  70.  
  71.         get_user_authid(id, auth, charsmax(auth));
  72.         get_user_ip(id, ip, charsmax(ip), 1/*no port*/);
  73.  
  74.         new last = 0;
  75.        
  76.         if (g_Size < sizeof(g_SteamIDs))
  77.         {
  78.             last = g_Size - 1;
  79.         }
  80.         else
  81.         {
  82.             last = g_Tracker - 1;
  83.            
  84.             if (last < 0)
  85.             {
  86.                 last = g_Size - 1;
  87.             }
  88.         }
  89.        
  90.         if (equal(auth, g_SteamIDs[last]) &&
  91.             equal(ip, g_IPs[last])) // need to check ip too, or all the nosteams will while it doesn't work with their illegitimate server
  92.         {
  93.             get_user_name(id, g_Names[last], charsmax(g_Names[]));
  94.             g_Access[last] = get_user_flags(id);
  95.            
  96.             return;
  97.         }
  98.     }
  99.    
  100.     // Need to insert the entry
  101.    
  102.     new target = 0;  // the slot to save the info at
  103.  
  104.     // Queue is not yet full
  105.     if (g_Size < sizeof(g_SteamIDs))
  106.     {
  107.         target = g_Size;
  108.        
  109.         ++g_Size;
  110.        
  111.     }
  112.     else
  113.     {
  114.         target = g_Tracker;
  115.        
  116.         ++g_Tracker;
  117.         // If we reached the end of the array, then move to the front
  118.         if (g_Tracker == sizeof(g_SteamIDs))
  119.         {
  120.             g_Tracker = 0;
  121.         }
  122.     }
  123.    
  124.     get_user_authid(id, g_SteamIDs[target], charsmax(g_SteamIDs[]));
  125.     get_user_name(id, g_Names[target], charsmax(g_Names[]));
  126.     get_user_ip(id, g_IPs[target], charsmax(g_IPs[]), 1/*no port*/);
  127.    
  128.     g_Access[target] = get_user_flags(id);
  129.  
  130. }
  131. stock GetInfo(i, name[], namesize, auth[], authsize, ip[], ipsize, &access)
  132. {
  133.     if (i >= g_Size)
  134.     {
  135.         abort(AMX_ERR_NATIVE, "GetInfo: Out of bounds (%d:%d)", i, g_Size);
  136.     }
  137.    
  138.     new target = (g_Tracker + i) % sizeof(g_SteamIDs);
  139.    
  140.     copy(name, namesize, g_Names[target]);
  141.     copy(auth, authsize, g_SteamIDs[target]);
  142.     copy(ip,   ipsize,   g_IPs[target]);
  143.     access = g_Access[target];
  144.    
  145. }
  146. public client_disconnect(id)
  147. {
  148.     if (!is_user_bot(id))
  149.     {
  150.         InsertInfo(id);
  151.     }
  152. }
  153.  
  154. public plugin_init()
  155. {
  156.     register_plugin("Admin Commands", AMXX_VERSION_STR, "AMXX Dev Team")
  157.  
  158.     register_dictionary("admincmd.txt")
  159.     register_dictionary("common.txt")
  160.     register_dictionary("adminhelp.txt")
  161.    
  162.    
  163.     register_concmd("amx_kick", "cmdKick", ADMIN_KICK, "<name or #userid> [reason]")
  164.     register_concmd("amx_ban", "cmdBan", ADMIN_BAN, "<name or #userid> <minutes> [reason]")
  165.     register_concmd("amx_banip", "cmdBanIP", ADMIN_BAN, "<name or #userid> <minutes> [reason]")
  166.     register_concmd("amx_addban", "cmdAddBan", ADMIN_BAN, "<^"authid^" or ip> <minutes> [reason]")
  167.     register_concmd("amx_unban", "cmdUnban", ADMIN_BAN, "<^"authid^" or ip>")
  168.     register_concmd("amx_slay", "cmdSlay", ADMIN_SLAY, "<name or #userid>")
  169.     register_concmd("amx_slap", "cmdSlap", ADMIN_SLAY, "<name or #userid> [power]")
  170.     register_concmd("amx_leave", "cmdLeave", ADMIN_KICK, "<tag> [tag] [tag] [tag]")
  171.     register_concmd("amx_pause", "cmdPause", ADMIN_CVAR, "- pause or unpause the game")
  172.     register_concmd("amx_who", "cmdWho", ADMIN_ADMIN, "- displays who is on server")
  173.     register_concmd("amx_cvar", "cmdCvar", ADMIN_CVAR, "<cvar> [value]")
  174.     register_concmd("amx_plugins", "cmdPlugins", ADMIN_ADMIN)
  175.     register_concmd("amx_modules", "cmdModules", ADMIN_ADMIN)
  176.     register_concmd("amx_map", "cmdMap", ADMIN_MAP, "<mapname>")
  177.     register_concmd("amx_extendmap", "cmdExtendMap", ADMIN_MAP, "<number of minutes>")
  178.     register_concmd("amx_cfg", "cmdCfg", ADMIN_CFG, "<filename>")
  179.     register_concmd("amx_nick", "cmdNick", ADMIN_SLAY, "<name or #userid> <new nick>")
  180.     register_concmd("amx_last", "cmdLast", ADMIN_BAN, "- list the last few disconnected clients info");
  181.     register_clcmd("amx_rcon", "cmdRcon", ADMIN_RCON, "<command line>")
  182.     register_clcmd("amx_showrcon", "cmdShowRcon", ADMIN_RCON, "<command line>")
  183.     register_clcmd("pauseAck", "cmdLBack")
  184.  
  185.  
  186.     rcon_password=get_cvar_pointer("rcon_password");
  187.     pausable=get_cvar_pointer("pausable");
  188.    
  189.     HandleCvarTimeLimit = get_cvar_pointer( "mp_timelimit" );
  190. }
  191.  
  192. public plugin_cfg()
  193. {
  194.     // Cvars which can be changed only with rcon access
  195.     server_cmd(g_addCvar, "rcon_password")
  196.     server_cmd(g_addCvar, "amx_show_activity")
  197.     server_cmd(g_addCvar, "amx_mode")
  198.     server_cmd(g_addCvar, "amx_password_field")
  199.     server_cmd(g_addCvar, "amx_default_access")
  200.     server_cmd(g_addCvar, "amx_reserved_slots")
  201.     server_cmd(g_addCvar, "amx_reservation")
  202.     server_cmd(g_addCvar, "amx_sql_table");
  203.     server_cmd(g_addCvar, "amx_sql_host");
  204.     server_cmd(g_addCvar, "amx_sql_user");
  205.     server_cmd(g_addCvar, "amx_sql_pass");
  206.     server_cmd(g_addCvar, "amx_sql_db");
  207.     server_cmd(g_addCvar, "amx_sql_type");
  208.  
  209. }
  210.  
  211. public cmdKick(id, level, cid)
  212. {
  213.     if (!cmd_access(id, level, cid, 2))
  214.         return PLUGIN_HANDLED
  215.  
  216.     new arg[32]
  217.     read_argv(1, arg, 31)
  218.     new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
  219.    
  220.     if (!player)
  221.         return PLUGIN_HANDLED
  222.    
  223.     new authid[32], authid2[32], name2[32], name[32], userid2, reason[32]
  224.    
  225.     get_user_authid(id, authid, 31)
  226.     get_user_authid(player, authid2, 31)
  227.     get_user_name(player, name2, 31)
  228.     get_user_name(id, name, 31)
  229.     userid2 = get_user_userid(player)
  230.     read_argv(2, reason, 31)
  231.     remove_quotes(reason)
  232.    
  233.     log_amx("Kick: ^"%s<%d><%s><>^" kick ^"%s<%d><%s><>^" (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, reason)
  234.  
  235.     show_activity_key("ADMIN_KICK_1", "ADMIN_KICK_2", name, name2);
  236.  
  237.     if (is_user_bot(player))
  238.         server_cmd("kick #%d", userid2)
  239.     else
  240.     {
  241.         if (reason[0])
  242.             server_cmd("kick #%d ^"%s^"", userid2, reason)
  243.         else
  244.             server_cmd("kick #%d", userid2)
  245.     }
  246.    
  247.     console_print(id, "[AMXX] Client ^"%s^" kicked", name2)
  248.    
  249.     return PLUGIN_HANDLED
  250. }
  251.  
  252. public cmdUnban(id, level, cid)
  253. {
  254.     if (!cmd_access(id, level, cid, 2))
  255.         return PLUGIN_HANDLED
  256.    
  257.     new arg[32], authid[32], name[32]
  258.    
  259.     read_argv(1, arg, 31)
  260.    
  261.     if (contain(arg, ".") != -1)
  262.     {
  263.         server_cmd("removeip ^"%s^";writeip", arg)
  264.         console_print(id, "[AMXX] %L", id, "IP_REMOVED", arg)
  265.     } else {
  266.         server_cmd("removeid %s;writeid", arg)
  267.         console_print(id, "[AMXX] %L", id, "AUTHID_REMOVED", arg)
  268.     }
  269.  
  270.     get_user_name(id, name, 31)
  271.  
  272.     show_activity_key("ADMIN_UNBAN_1", "ADMIN_UNBAN_2", name, arg);
  273.  
  274.     get_user_authid(id, authid, 31)
  275.     log_amx("Cmd: ^"%s<%d><%s><>^" unban ^"%s^"", name, get_user_userid(id), authid, arg)
  276.    
  277.     return PLUGIN_HANDLED
  278. }
  279.  
  280. /* amx_addban is a special command now.
  281.  * If a user with rcon uses it, it bans the user.  No questions asked.
  282.  * If a user without rcon but with ADMIN_BAN uses it, it will scan the old
  283.  * connection queue, and if it finds the info for a player in it, it will
  284.  * check their old access.  If they have immunity, it will not ban.
  285.  * If they do not have immunity, it will ban.  If the user is not found,
  286.  * it will refuse to ban the target.
  287.  */
  288.  
  289. public cmdAddBan(id, level, cid)
  290. {
  291.     if (!cmd_access(id, level, cid, 3, true)) // check for ADMIN_BAN access
  292.     {
  293.         if (get_user_flags(id) & level) // Getting here means they didn't input enough args
  294.         {
  295.             return PLUGIN_HANDLED;
  296.         }
  297.         if (!cmd_access(id, ADMIN_RCON, cid, 3)) // If somehow they have ADMIN_RCON without ADMIN_BAN, continue
  298.         {
  299.             return PLUGIN_HANDLED;
  300.         }
  301.     }
  302.  
  303.     new arg[32], authid[32], name[32], minutes[32], reason[32]
  304.    
  305.     read_argv(1, arg, 31)
  306.     read_argv(2, minutes, 31)
  307.     read_argv(3, reason, 31)
  308.    
  309.    
  310.     if (!(get_user_flags(id) & ADMIN_RCON))
  311.     {
  312.         new bool:canban = false;
  313.         new bool:isip = false;
  314.         // Limited access to this command
  315.         if (equali(arg, "STEAM_ID_PENDING") ||
  316.             equali(arg, "STEAM_ID_LAN") ||
  317.             equali(arg, "HLTV") ||
  318.             equali(arg, "4294967295") ||
  319.             equali(arg, "VALVE_ID_LAN") ||
  320.             equali(arg, "VALVE_ID_PENDING"))
  321.         {
  322.             // Hopefully we never get here, so ML shouldn't be needed
  323.             console_print(id, "Cannot ban %s", arg);
  324.             return PLUGIN_HANDLED;
  325.         }
  326.        
  327.         if (contain(arg, ".") != -1)
  328.         {
  329.             isip = true;
  330.         }
  331.        
  332.         // Scan the disconnection queue
  333.         if (isip)
  334.         {
  335.             new IP[32];
  336.             new Name[32];
  337.             new dummy[1];
  338.             new Access;
  339.             for (new i = 0; i < g_Size; i++)
  340.             {
  341.                 GetInfo(i, Name, charsmax(Name), dummy, 0, IP, charsmax(IP), Access);
  342.                
  343.                 if (equal(IP, arg))
  344.                 {
  345.                     if (Access & ADMIN_IMMUNITY)
  346.                     {
  347.                         console_print(id, "[AMXX] %s : %L", IP, id, "CLIENT_IMM", Name);
  348.                        
  349.                         return PLUGIN_HANDLED;
  350.                     }
  351.                     // User did not have immunity
  352.                     canban = true;
  353.                 }
  354.             }
  355.         }
  356.         else
  357.         {
  358.             new Auth[32];
  359.             new Name[32];
  360.             new dummy[1];
  361.             new Access;
  362.             for (new i = 0; i < g_Size; i++)
  363.             {
  364.                 GetInfo(i, Name, charsmax(Name), Auth, charsmax(Auth), dummy, 0, Access);
  365.                
  366.                 if (equal(Auth, arg))
  367.                 {
  368.                     if (Access & ADMIN_IMMUNITY)
  369.                     {
  370.                         console_print(id, "[AMXX] %s : %L", Auth, id, "CLIENT_IMM", Name);
  371.                        
  372.                         return PLUGIN_HANDLED;
  373.                     }
  374.                     // User did not have immunity
  375.                     canban = true;
  376.                 }
  377.             }
  378.         }
  379.        
  380.         if (!canban)
  381.         {
  382.             console_print(id, "[AMXX] You may only ban recently disconnected clients.  Use ^"amx_last^" to view.");
  383.            
  384.             return PLUGIN_HANDLED;
  385.         }
  386.        
  387.     }
  388.    
  389.     // User has access to ban their target
  390.     if (contain(arg, ".") != -1)
  391.     {
  392.         server_cmd("addip ^"%s^" ^"%s^";wait;writeip", minutes, arg)
  393.         console_print(id, "[AMXX] Ip ^"%s^" added to ban list", arg)
  394.     } else {
  395.         server_cmd("banid %s %s;wait;writeid", minutes, arg)
  396.         console_print(id, "[AMXX] Authid ^"%s^" added to ban list", arg)
  397.     }
  398.  
  399.     get_user_name(id, name, 31)
  400.  
  401.     show_activity_key("ADMIN_ADDBAN_1", "ADMIN_ADDBAN_2", name, arg);
  402.  
  403.     get_user_authid(id, authid, 31)
  404.     log_amx("Cmd: ^"%s<%d><%s><>^" ban ^"%s^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, arg, minutes, reason)
  405.  
  406.     return PLUGIN_HANDLED
  407. }
  408.  
  409. public cmdBan(id, level, cid)
  410. {
  411.     if (!cmd_access(id, level, cid, 3))
  412.         return PLUGIN_HANDLED
  413.  
  414.     new target[32], minutes[8], reason[64]
  415.    
  416.     read_argv(1, target, 31)
  417.     read_argv(2, minutes, 7)
  418.     read_argv(3, reason, 63)
  419.    
  420.     new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)
  421.    
  422.     if (!player)
  423.         return PLUGIN_HANDLED
  424.  
  425.     new authid[32], name2[32], authid2[32], name[32]
  426.     new userid2 = get_user_userid(player)
  427.  
  428.     get_user_authid(player, authid2, 31)
  429.     get_user_authid(id, authid, 31)
  430.     get_user_name(player, name2, 31)
  431.     get_user_name(id, name, 31)
  432.    
  433.     log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)
  434.    
  435.     new temp[64], banned[16], nNum = str_to_num(minutes)
  436.     if (nNum)
  437.         format(temp, 63, "%L", player, "FOR_MIN", minutes)
  438.     else
  439.         format(temp, 63, "%L", player, "PERM")
  440.  
  441.     format(banned, 15, "%L", player, "BANNED")
  442.  
  443.     if (reason[0])
  444.         server_cmd("kick #%d ^"%s (%s %s)^";wait;banid %s %s;wait;writeid", userid2, reason, banned, temp, minutes, authid2)
  445.     else
  446.         server_cmd("kick #%d ^"%s %s^";wait;banid %s %s;wait;writeid", userid2, banned, temp, minutes, authid2)
  447.  
  448.    
  449.     // Display the message to all clients
  450.  
  451.     new msg[256];
  452.     new len;
  453.     new maxpl = get_maxplayers();
  454.     for (new i = 1; i <= maxpl; i++)
  455.     {
  456.         if (is_user_connected(i) && !is_user_bot(i))
  457.         {
  458.             len = formatex(msg, charsmax(msg), "%L", i, "BAN");
  459.             len += formatex(msg[len], charsmax(msg) - len, " %s ", name2);
  460.             if (nNum)
  461.             {
  462.                 len += formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes);
  463.             }
  464.             else
  465.             {
  466.                 len += formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM");
  467.             }
  468.             if (strlen(reason) > 0)
  469.             {
  470.                 formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason);
  471.             }
  472.             show_activity_id(i, id, name, msg);
  473.         }
  474.     }
  475.    
  476.     console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)
  477.    
  478.     return PLUGIN_HANDLED
  479. }
  480.  
  481. public cmdBanIP(id, level, cid)
  482. {
  483.     if (!cmd_access(id, level, cid, 3))
  484.         return PLUGIN_HANDLED
  485.    
  486.     new target[32], minutes[8], reason[64]
  487.    
  488.     read_argv(1, target, 31)
  489.     read_argv(2, minutes, 7)
  490.     read_argv(3, reason, 63)
  491.    
  492.     new player = cmd_target(id, target, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_NO_BOTS | CMDTARGET_ALLOW_SELF)
  493.    
  494.     if (!player)
  495.     {
  496.         // why is this here?
  497.         // no idea
  498.         // player = cmd_target(id, target, 9);
  499.         return PLUGIN_HANDLED
  500.     }
  501.    
  502.     new authid[32], name2[32], authid2[32], name[32]
  503.     new userid2 = get_user_userid(player)
  504.    
  505.     get_user_authid(player, authid2, 31)
  506.     get_user_authid(id, authid, 31)
  507.     get_user_name(player, name2, 31)
  508.     get_user_name(id, name, 31)
  509.    
  510.     log_amx("Ban: ^"%s<%d><%s><>^" ban and kick ^"%s<%d><%s><>^" (minutes ^"%s^") (reason ^"%s^")", name, get_user_userid(id), authid, name2, userid2, authid2, minutes, reason)
  511.  
  512.     new temp[64], banned[16], nNum = str_to_num(minutes)
  513.     if (nNum)
  514.         format(temp, 63, "%L", player, "FOR_MIN", minutes)
  515.     else
  516.         format(temp, 63, "%L", player, "PERM")
  517.     format(banned, 15, "%L", player, "BANNED")
  518.  
  519.     new address[32]
  520.     get_user_ip(player, address, 31, 1)
  521.  
  522.     if (reason[0])
  523.         server_cmd("kick #%d ^"%s (%s %s)^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, reason, banned, temp, minutes, address)
  524.     else
  525.         server_cmd("kick #%d ^"%s %s^";wait;addip ^"%s^" ^"%s^";wait;writeip", userid2, banned, temp, minutes, address)
  526.  
  527.     // Display the message to all clients
  528.  
  529.     new msg[256];
  530.     new len;
  531.     new maxpl = get_maxplayers();
  532.     for (new i = 1; i <= maxpl; i++)
  533.     {
  534.         if (is_user_connected(i) && !is_user_bot(i))
  535.         {
  536.             len = formatex(msg, charsmax(msg), "%L", i, "BAN");
  537.             len += formatex(msg[len], charsmax(msg) - len, " %s ", name2);
  538.             if (nNum)
  539.             {
  540.                 formatex(msg[len], charsmax(msg) - len, "%L", i, "FOR_MIN", minutes);
  541.             }
  542.             else
  543.             {
  544.                 formatex(msg[len], charsmax(msg) - len, "%L", i, "PERM");
  545.             }
  546.             if (strlen(reason) > 0)
  547.             {
  548.                 formatex(msg[len], charsmax(msg) - len, " (%L: %s)", i, "REASON", reason);
  549.             }
  550.             show_activity_id(i, id, name, msg);
  551.         }
  552.     }
  553.  
  554.     console_print(id, "[AMXX] %L", id, "CLIENT_BANNED", name2)
  555.    
  556.     return PLUGIN_HANDLED
  557. }
  558.  
  559. public cmdSlay(id, level, cid)
  560. {
  561.     if (!cmd_access(id, level, cid, 2))
  562.         return PLUGIN_HANDLED
  563.    
  564.     new arg[32]
  565.    
  566.     read_argv(1, arg, 31)
  567.    
  568.     new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)
  569.    
  570.     if (!player)
  571.         return PLUGIN_HANDLED
  572.    
  573.     user_kill(player)
  574.    
  575.     new authid[32], name2[32], authid2[32], name[32]
  576.    
  577.     get_user_authid(id, authid, 31)
  578.     get_user_name(id, name, 31)
  579.     get_user_authid(player, authid2, 31)
  580.     get_user_name(player, name2, 31)
  581.    
  582.     log_amx("Cmd: ^"%s<%d><%s><>^" slay ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, name2, get_user_userid(player), authid2)
  583.  
  584.     show_activity_key("ADMIN_SLAY_1", "ADMIN_SLAY_2", name, name2);
  585.  
  586.     console_print(id, "[AMXX] %L", id, "CLIENT_SLAYED", name2)
  587.    
  588.     return PLUGIN_HANDLED
  589. }
  590.  
  591. public cmdSlap(id, level, cid)
  592. {
  593.     if (!cmd_access(id, level, cid, 2))
  594.         return PLUGIN_HANDLED
  595.  
  596.     new arg[32]
  597.    
  598.     read_argv(1, arg, 31)
  599.     new player = cmd_target(id, arg, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF | CMDTARGET_ONLY_ALIVE)
  600.    
  601.     if (!player)
  602.         return PLUGIN_HANDLED
  603.  
  604.     new spower[32], authid[32], name2[32], authid2[32], name[32]
  605.    
  606.     read_argv(2, spower, 31)
  607.    
  608.     new damage = str_to_num(spower)
  609.    
  610.     user_slap(player, damage)
  611.    
  612.     get_user_authid(id, authid, 31)
  613.     get_user_name(id, name, 31)
  614.     get_user_authid(player, authid2, 31)
  615.     get_user_name(player, name2, 31)
  616.    
  617.     log_amx("Cmd: ^"%s<%d><%s><>^" slap with %d damage ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, damage, name2, get_user_userid(player), authid2)
  618.  
  619.     show_activity_key("ADMIN_SLAP_1", "ADMIN_SLAP_2", name, name2, damage);
  620.  
  621.     console_print(id, "[AMXX] %L", id, "CLIENT_SLAPED", name2, damage)
  622.    
  623.     return PLUGIN_HANDLED
  624. }
  625.  
  626. public chMap(map[])
  627. {
  628.     server_cmd("changelevel %s", map)
  629. }
  630.  
  631. public cmdMap(id, level, cid)
  632. {
  633.     if (!cmd_access(id, level, cid, 2))
  634.         return PLUGIN_HANDLED
  635.  
  636.     new arg[32]
  637.     new arglen = read_argv(1, arg, 31)
  638.    
  639.     if (!is_map_valid(arg))
  640.     {
  641.         console_print(id, "[AMXX] %L", id, "MAP_NOT_FOUND")
  642.         return PLUGIN_HANDLED
  643.     }
  644.  
  645.     new authid[32], name[32]
  646.    
  647.     get_user_authid(id, authid, 31)
  648.     get_user_name(id, name, 31)
  649.    
  650.     show_activity_key("ADMIN_MAP_1", "ADMIN_MAP_2", name, arg);
  651.    
  652.     log_amx("Cmd: ^"%s<%d><%s><>^" changelevel ^"%s^"", name, get_user_userid(id), authid, arg)
  653.    
  654.     new _modName[10]
  655.     get_modname(_modName, 9)
  656.    
  657.     if (!equal(_modName, "zp"))
  658.     {
  659.         message_begin(MSG_ALL, SVC_INTERMISSION)
  660.         message_end()
  661.     }
  662.    
  663.     set_task(2.0, "chMap", 0, arg, arglen + 1)
  664.    
  665.     return PLUGIN_HANDLED
  666. }
  667.  
  668. public cmdExtendMap( id, level, cid )
  669. {
  670.     if( !cmd_access( id, level, cid, 2 ) )
  671.     {
  672.         return PLUGIN_HANDLED;
  673.     }
  674.    
  675.     new arg[ 12 ]
  676.     read_argv( 1, arg, charsmax( arg ) );
  677.    
  678.     new minutes = str_to_num( arg );
  679.    
  680.     if( minutes > 0 )
  681.     {
  682.         new name[ 32 ], map[ 32 ];
  683.        
  684.         set_pcvar_num( HandleCvarTimeLimit, get_pcvar_num( HandleCvarTimeLimit ) + minutes );
  685.  
  686.         get_user_name( id, name, charsmax( name ) );
  687.         get_mapname( map, charsmax( map ) );
  688.  
  689.         show_activity_key( "ADMIN_EXTEND_1", "ADMIN_EXTEND_2", name, minutes );
  690.         console_print( id, "[AMXX] %L", id, "MAP_EXTENDED", map, minutes );
  691.     }
  692.    
  693.     return PLUGIN_HANDLED;
  694. }
  695.  
  696. stock bool:onlyRcon(const name[])
  697. {
  698.     new ptr=get_cvar_pointer(name);
  699.     if (ptr && get_pcvar_flags(ptr) & FCVAR_PROTECTED)
  700.     {
  701.         return true;
  702.     }
  703.     return false;
  704. }
  705.  
  706. public cmdCvar(id, level, cid)
  707. {
  708.     if (!cmd_access(id, level, cid, 2))
  709.         return PLUGIN_HANDLED
  710.    
  711.     new arg[32], arg2[64]
  712.    
  713.     read_argv(1, arg, 31)
  714.     read_argv(2, arg2, 63)
  715.    
  716.     new pointer;
  717.    
  718.     if (equal(arg, "add") && (get_user_flags(id) & ADMIN_RCON))
  719.     {
  720.         if ((pointer=get_cvar_pointer(arg2))!=0)
  721.         {
  722.             new flags=get_pcvar_flags(pointer);
  723.            
  724.             if (!(flags & FCVAR_PROTECTED))
  725.             {
  726.                 set_pcvar_flags(pointer,flags | FCVAR_PROTECTED);
  727.             }
  728.         }
  729.         return PLUGIN_HANDLED
  730.     }
  731.    
  732.     if ((pointer=get_cvar_pointer(arg))==0)
  733.     {
  734.         console_print(id, "[AMXX] %L", id, "UNKNOWN_CVAR", arg)
  735.         return PLUGIN_HANDLED
  736.     }
  737.    
  738.     if (onlyRcon(arg) && !(get_user_flags(id) & ADMIN_RCON))
  739.     {
  740.         // Exception for the new onlyRcon rules:
  741.         //   sv_password is allowed to be modified by ADMIN_PASSWORD
  742.         if (!(equali(arg,"sv_password") && (get_user_flags(id) & ADMIN_PASSWORD)))
  743.         {
  744.             console_print(id, "[AMXX] %L", id, "CVAR_NO_ACC")
  745.             return PLUGIN_HANDLED
  746.         }
  747.     }
  748.    
  749.     if (read_argc() < 3)
  750.     {
  751.         get_pcvar_string(pointer, arg2, 63)
  752.         console_print(id, "[AMXX] %L", id, "CVAR_IS", arg, arg2)
  753.         return PLUGIN_HANDLED
  754.     }
  755.  
  756.     new authid[32], name[32]
  757.    
  758.     get_user_authid(id, authid, 31)
  759.     get_user_name(id, name, 31)
  760.    
  761.     log_amx("Cmd: ^"%s<%d><%s><>^" set cvar (name ^"%s^") (value ^"%s^")", name, get_user_userid(id), authid, arg, arg2)
  762.     set_cvar_string(arg, arg2)
  763.    
  764.    
  765.     // Display the message to all clients
  766.  
  767.     new cvar_val[64];
  768.     new maxpl = get_maxplayers();
  769.     for (new i = 1; i <= maxpl; i++)
  770.     {
  771.         if (is_user_connected(i) && !is_user_bot(i))
  772.         {
  773.             if (get_pcvar_flags(pointer) & FCVAR_PROTECTED || equali(arg, "rcon_password"))
  774.             {
  775.                 formatex(cvar_val, charsmax(cvar_val), "*** %L ***", i, "PROTECTED");
  776.             }
  777.             else
  778.             {
  779.                 copy(cvar_val, charsmax(cvar_val), arg2);
  780.             }
  781.             show_activity_id(i, id, name, "%L", i, "SET_CVAR_TO", "", arg, cvar_val);
  782.         }
  783.     }
  784.  
  785.     console_print(id, "[AMXX] %L", id, "CVAR_CHANGED", arg, arg2)
  786.    
  787.     return PLUGIN_HANDLED
  788. }
  789.  
  790. public cmdPlugins(id, level, cid)
  791. {
  792.     if (!cmd_access(id, level, cid, 1))
  793.         return PLUGIN_HANDLED
  794.        
  795.     if (id==0) // If server executes redirect this to "amxx plugins" for more in depth output
  796.     {
  797.         server_cmd("amxx plugins");
  798.         server_exec();
  799.         return PLUGIN_HANDLED;
  800.     }
  801.  
  802.     new name[32], version[32], author[32], filename[32], status[32]
  803.     new lName[32], lVersion[32], lAuthor[32], lFile[32], lStatus[32]
  804.  
  805.     format(lName, 31, "%L", id, "NAME")
  806.     format(lVersion, 31, "%L", id, "VERSION")
  807.     format(lAuthor, 31, "%L", id, "AUTHOR")
  808.     format(lFile, 31, "%L", id, "FILE")
  809.     format(lStatus, 31, "%L", id, "STATUS")
  810.  
  811.     new StartPLID=0;
  812.     new EndPLID;
  813.  
  814.     new Temp[96]
  815.  
  816.     new num = get_pluginsnum()
  817.    
  818.     if (read_argc() > 1)
  819.     {
  820.         read_argv(1,Temp,sizeof(Temp)-1);
  821.         StartPLID=str_to_num(Temp)-1; // zero-based
  822.     }
  823.  
  824.     EndPLID=min(StartPLID + 10, num);
  825.    
  826.     new running = 0
  827.    
  828.     console_print(id, "----- %L -----", id, "LOADED_PLUGINS")
  829.     console_print(id, "%-18.17s %-11.10s %-17.16s %-16.15s %-9.8s", lName, lVersion, lAuthor, lFile, lStatus)
  830.  
  831.     new i=StartPLID;
  832.     while (i <EndPLID)
  833.     {
  834.         get_plugin(i++, filename, 31, name, 31, version, 31, author, 31, status, 31)
  835.         console_print(id, "%-18.17s %-11.10s %-17.16s %-16.15s %-9.8s", name, version, author, filename, status)
  836.        
  837.         if (status[0]=='d' || status[0]=='r') // "debug" or "running"
  838.             running++
  839.     }
  840.     console_print(id, "%L", id, "PLUGINS_RUN", EndPLID-StartPLID, running)
  841.     console_print(id, "----- %L -----",id,"HELP_ENTRIES",StartPLID + 1,EndPLID,num);
  842.    
  843.     if (EndPLID < num)
  844.     {
  845.         formatex(Temp,sizeof(Temp)-1,"----- %L -----",id,"HELP_USE_MORE", EndPLID + 1);
  846.         replace_all(Temp,sizeof(Temp)-1,"amx_help","amx_plugins");
  847.         console_print(id,"%s",Temp);
  848.     }
  849.     else
  850.     {
  851.         formatex(Temp,sizeof(Temp)-1,"----- %L -----",id,"HELP_USE_BEGIN");
  852.         replace_all(Temp,sizeof(Temp)-1,"amx_help","amx_plugins");
  853.         console_print(id,"%s",Temp);
  854.     }
  855.  
  856.     return PLUGIN_HANDLED
  857. }
  858.  
  859. public cmdModules(id, level, cid)
  860. {
  861.     if (!cmd_access(id, level, cid, 1))
  862.         return PLUGIN_HANDLED
  863.  
  864.     new name[32], version[32], author[32], status, sStatus[16]
  865.     new lName[32], lVersion[32], lAuthor[32], lStatus[32];
  866.  
  867.     format(lName, 31, "%L", id, "NAME")
  868.     format(lVersion, 31, "%L", id, "VERSION")
  869.     format(lAuthor, 31, "%L", id, "AUTHOR")
  870.     format(lStatus, charsmax(lStatus), "%L", id, "STATUS")
  871.  
  872.     new num = get_modulesnum()
  873.    
  874.     console_print(id, "%L:", id, "LOADED_MODULES")
  875.     console_print(id, "%-23.22s %-11.10s %-20.19s %-11.10s", lName, lVersion, lAuthor, lStatus)
  876.    
  877.     for (new i = 0; i < num; i++)
  878.     {
  879.         get_module(i, name, 31, author, 31, version, 31, status)
  880.        
  881.         switch (status)
  882.         {
  883.             case module_loaded: copy(sStatus, 15, "running")
  884.             default:
  885.             {
  886.                 copy(sStatus, 15, "bad load");
  887.                 copy(name, charsmax(name), "unknown");
  888.                 copy(author, charsmax(author), "unknown");
  889.                 copy(version, charsmax(version), "unknown");
  890.             }
  891.         }
  892.        
  893.         console_print(id, "%-23.22s %-11.10s %-20.19s %-11.10s", name, version, author, sStatus)
  894.     }
  895.     console_print(id, "%L", id, "NUM_MODULES", num)
  896.  
  897.     return PLUGIN_HANDLED
  898. }
  899.  
  900. public cmdCfg(id, level, cid)
  901. {
  902.     if (!cmd_access(id, level, cid, 2))
  903.         return PLUGIN_HANDLED
  904.    
  905.     new arg[128]
  906.     read_argv(1, arg, 127)
  907.    
  908.     if (!file_exists(arg))
  909.     {
  910.         console_print(id, "[AMXX] %L", id, "FILE_NOT_FOUND", arg)
  911.         return PLUGIN_HANDLED
  912.     }
  913.    
  914.     new authid[32], name[32]
  915.    
  916.     get_user_authid(id, authid, 31)
  917.     get_user_name(id, name, 31)
  918.    
  919.     log_amx("Cmd: ^"%s<%d><%s><>^" execute cfg (file ^"%s^")", name, get_user_userid(id), authid, arg)
  920.    
  921.     console_print(id, "[AMXX] Executing file ^"%s^"", arg)
  922.     server_cmd("exec %s", arg)
  923.  
  924.     show_activity_key("ADMIN_CONF_1", "ADMIN_CONF_2", name, arg);
  925.  
  926.     return PLUGIN_HANDLED
  927. }
  928.  
  929. public cmdLBack()
  930. {
  931.     if (!g_PauseAllowed)
  932.         return PLUGIN_CONTINUE 
  933.  
  934.     new paused[25]
  935.    
  936.     format(paused, 24, "%L", g_pauseCon, g_Paused ? "UNPAUSED" : "PAUSED")
  937.     set_cvar_float("pausable", g_pausAble)
  938.     console_print(g_pauseCon, "[AMXX] Server %s", paused)
  939.     g_PauseAllowed = false
  940.    
  941.     if (g_Paused)
  942.         g_Paused = false
  943.     else
  944.         g_Paused = true
  945.    
  946.     return PLUGIN_HANDLED
  947. }
  948.  
  949. public cmdPause(id, level, cid)
  950. {
  951.     if (!cmd_access(id, level, cid, 1))
  952.         return PLUGIN_HANDLED
  953.    
  954.     new authid[32], name[32], slayer = id
  955.    
  956.     get_user_authid(id, authid, 31)
  957.     get_user_name(id, name, 31)
  958.     if (pausable!=0)
  959.     {
  960.         g_pausAble = get_pcvar_float(pausable)
  961.     }
  962.    
  963.     if (!slayer)
  964.         slayer = find_player("h")
  965.    
  966.     if (!slayer)
  967.     {
  968.         console_print(id, "[AMXX] %L", id, "UNABLE_PAUSE")
  969.         return PLUGIN_HANDLED
  970.     }
  971.  
  972.     set_cvar_float("pausable", 1.0)
  973.     g_PauseAllowed = true
  974.     client_cmd(slayer, "pause;pauseAck")
  975.    
  976.     log_amx("Cmd: ^"%s<%d><%s><>^" %s server", name, get_user_userid(id), authid, g_Paused ? "unpause" : "pause")
  977.    
  978.     console_print(id, "[AMXX] %L", id, g_Paused ? "UNPAUSING" : "PAUSING")
  979.  
  980.     // Display the message to all clients
  981.  
  982.     new maxpl = get_maxplayers();
  983.     for (new i = 1; i <= maxpl; i++)
  984.     {
  985.         if (is_user_connected(i) && !is_user_bot(i))
  986.         {
  987.             show_activity_id(i, id, name, "%L server", i, g_Paused ? "UNPAUSE" : "PAUSE");
  988.         }
  989.     }
  990.  
  991.     g_pauseCon = id
  992.    
  993.     return PLUGIN_HANDLED
  994. }
  995.  
  996. public cmdShowRcon(id, level, cid)
  997. {
  998.     if (!cmd_access(id, level, cid, 2))
  999.         return PLUGIN_HANDLED
  1000.        
  1001.     new password[64]
  1002.    
  1003.     get_pcvar_string(rcon_password, password, 63)
  1004.    
  1005.     if (!password[0])
  1006.     {
  1007.         cmdRcon(id, level, cid)
  1008.     } else {
  1009.         new args[128]
  1010.        
  1011.         read_args(args, 127)
  1012.         client_cmd(id, "rcon_password %s", password)
  1013.         client_cmd(id, "rcon %s", args)
  1014.     }
  1015.    
  1016.     return PLUGIN_HANDLED
  1017. }
  1018.  
  1019. public cmdRcon(id, level, cid)
  1020. {
  1021.     if (!cmd_access(id, level, cid, 2))
  1022.         return PLUGIN_HANDLED
  1023.    
  1024.     new arg[128], authid[32], name[32]
  1025.    
  1026.     read_args(arg, 127)
  1027.     get_user_authid(id, authid, 31)
  1028.     get_user_name(id, name, 31)
  1029.    
  1030.     log_amx("Cmd: ^"%s<%d><%s><>^" server console (cmdline ^"%s^")", name, get_user_userid(id), authid, arg)
  1031.    
  1032.     console_print(id, "[AMXX] %L", id, "COM_SENT_SERVER", arg)
  1033.     server_cmd("%s", arg)
  1034.    
  1035.     return PLUGIN_HANDLED
  1036. }
  1037.  
  1038. public cmdWho(id, level, cid)
  1039. {
  1040.     if (!cmd_access(id, level, cid, 1))
  1041.         return PLUGIN_HANDLED
  1042.  
  1043.     new players[32], inum, cl_on_server[64], authid[32], name[32], flags, sflags[32]
  1044.     new lImm[16], lRes[16], lAccess[16], lYes[16], lNo[16]
  1045.    
  1046.     format(lImm, 15, "%L", id, "IMMU")
  1047.     format(lRes, 15, "%L", id, "RESERV")
  1048.     format(lAccess, 15, "%L", id, "ACCESS")
  1049.     format(lYes, 15, "%L", id, "YES")
  1050.     format(lNo, 15, "%L", id, "NO")
  1051.    
  1052.     get_players(players, inum)
  1053.     format(cl_on_server, 63, "%L", id, "CLIENTS_ON_SERVER")
  1054.     console_print(id, "^n%s:^n #  %-16.15s %-20s %-8s %-4.3s %-4.3s %s", cl_on_server, "nick", "authid", "userid", lImm, lRes, lAccess)
  1055.    
  1056.     for (new a = 0; a < inum; ++a)
  1057.     {
  1058.         get_user_authid(players[a], authid, 31)
  1059.         get_user_name(players[a], name, 31)
  1060.         flags = get_user_flags(players[a])
  1061.         get_flags(flags, sflags, 31)
  1062.         console_print(id, "%2d  %-16.15s %-20s %-8d %-6.5s %-6.5s %s", players[a], name, authid,
  1063.         get_user_userid(players[a]), (flags&ADMIN_IMMUNITY) ? lYes : lNo, (flags&ADMIN_RESERVATION) ? lYes : lNo, sflags)
  1064.     }
  1065.    
  1066.     console_print(id, "%L", id, "TOTAL_NUM", inum)
  1067.     get_user_authid(id, authid, 31)
  1068.     get_user_name(id, name, 31)
  1069.     log_amx("Cmd: ^"%s<%d><%s><>^" ask for players list", name, get_user_userid(id), authid)
  1070.    
  1071.     return PLUGIN_HANDLED
  1072. }
  1073.  
  1074. hasTag(name[], tags[4][32], tagsNum)
  1075. {
  1076.     for (new a = 0; a < tagsNum; ++a)
  1077.         if (contain(name, tags[a]) != -1)
  1078.             return a
  1079.     return -1
  1080. }
  1081.  
  1082. public cmdLeave(id, level, cid)
  1083. {
  1084.     if (!cmd_access(id, level, cid, 2))
  1085.         return PLUGIN_HANDLED
  1086.    
  1087.     new argnum = read_argc()
  1088.     new ltags[4][32]
  1089.     new ltagsnum = 0
  1090.    
  1091.     for (new a = 1; a < 5; ++a)
  1092.     {
  1093.         if (a < argnum)
  1094.             read_argv(a, ltags[ltagsnum++], 31)
  1095.         else
  1096.             ltags[ltagsnum++][0] = 0
  1097.     }
  1098.    
  1099.     new nick[32], ires, pnum = get_maxplayers() + 1, count = 0, lReason[128]
  1100.    
  1101.     for (new b = 1; b < pnum; ++b)
  1102.     {
  1103.         if (!is_user_connected(b) && !is_user_connecting(b)) continue
  1104.  
  1105.         get_user_name(b, nick, 31)
  1106.         ires = hasTag(nick, ltags, ltagsnum)
  1107.        
  1108.         if (ires != -1)
  1109.         {
  1110.             console_print(id, "[AMXX] %L", id, "SKIP_MATCH", nick, ltags[ires])
  1111.             continue
  1112.         }
  1113.        
  1114.         if (get_user_flags(b) & ADMIN_IMMUNITY)
  1115.         {
  1116.             console_print(id, "[AMXX] %L", id, "SKIP_IMM", nick)
  1117.             continue
  1118.         }
  1119.        
  1120.         console_print(id, "[AMXX] %L", id, "KICK_PL", nick)
  1121.        
  1122.         if (is_user_bot(b))
  1123.             server_cmd("kick #%d", get_user_userid(b))
  1124.         else
  1125.         {
  1126.             format(lReason, 127, "%L", b, "YOU_DROPPED")
  1127.             server_cmd("kick #%d ^"%s^"", get_user_userid(b), lReason)
  1128.         }
  1129.         count++
  1130.     }
  1131.    
  1132.     console_print(id, "[AMXX] %L", id, "KICKED_CLIENTS", count)
  1133.    
  1134.     new authid[32], name[32]
  1135.  
  1136.     get_user_authid(id, authid, 31)
  1137.     get_user_name(id, name, 31)
  1138.     log_amx("Kick: ^"%s<%d><%s><>^" leave some group (tag1 ^"%s^") (tag2 ^"%s^") (tag3 ^"%s^") (tag4 ^"%s^")", name, get_user_userid(id), authid, ltags[0], ltags[1], ltags[2], ltags[3])
  1139.  
  1140.     show_activity_key("ADMIN_LEAVE_1", "ADMIN_LEAVE_2", name, ltags[0], ltags[1], ltags[2], ltags[3]);
  1141.  
  1142.     return PLUGIN_HANDLED
  1143. }
  1144.  
  1145. public cmdNick(id, level, cid)
  1146. {
  1147.     if (!cmd_access(id, level, cid, 3))
  1148.         return PLUGIN_HANDLED
  1149.  
  1150.     new arg1[32], arg2[32], authid[32], name[32], authid2[32], name2[32]
  1151.  
  1152.     read_argv(1, arg1, 31)
  1153.     read_argv(2, arg2, 31)
  1154.  
  1155.     new player = cmd_target(id, arg1, CMDTARGET_OBEY_IMMUNITY | CMDTARGET_ALLOW_SELF)
  1156.    
  1157.     if (!player)
  1158.         return PLUGIN_HANDLED
  1159.  
  1160.     get_user_authid(id, authid, 31)
  1161.     get_user_name(id, name, 31)
  1162.     get_user_authid(player, authid2, 31)
  1163.     get_user_name(player, name2, 31)
  1164.  
  1165.     client_cmd(player, "name ^"%s^"", arg2)
  1166.  
  1167.     log_amx("Cmd: ^"%s<%d><%s><>^" change nick to ^"%s^" ^"%s<%d><%s><>^"", name, get_user_userid(id), authid, arg2, name2, get_user_userid(player), authid2)
  1168.  
  1169.     show_activity_key("ADMIN_NICK_1", "ADMIN_NICK_2", name, name2, arg2);
  1170.  
  1171.     console_print(id, "[AMXX] %L", id, "CHANGED_NICK", name2, arg2)
  1172.  
  1173.     return PLUGIN_HANDLED
  1174. }
  1175.  
  1176. public cmdLast(id, level, cid)
  1177. {
  1178.     if (!cmd_access(id, level, cid, 1))
  1179.     {
  1180.         return PLUGIN_HANDLED;
  1181.     }
  1182.    
  1183.     new name[32];
  1184.     new authid[32];
  1185.     new ip[32];
  1186.     new flags[32];
  1187.     new access;
  1188.    
  1189.    
  1190.     // This alignment is a bit weird (it should grow if the name is larger)
  1191.     // but otherwise for the more common shorter name, it'll wrap in server console
  1192.     // Steam client display is all skewed anyway because of the non fixed font.
  1193.     console_print(id, "%19s %20s %15s %s", "name", "authid", "ip", "access");
  1194.    
  1195.     for (new i = 0; i < g_Size; i++)
  1196.     {
  1197.         GetInfo(i, name, charsmax(name), authid, charsmax(authid), ip, charsmax(ip), access);
  1198.        
  1199.         get_flags(access, flags, charsmax(flags));
  1200.        
  1201.         console_print(id, "%19s %20s %15s %s", name, authid, ip, flags);
  1202.     }
  1203.    
  1204.     console_print(id, "%d old connections saved.", g_Size);
  1205.    
  1206.     return PLUGIN_HANDLED;
  1207. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement