Directly kick players rather than use a loopback command (bug 3884, r=dvander).

Former-commit-id: dfe1903ecf4faa49b83b85213aa0fbc083fbb0c2
This commit is contained in:
Lev2001 2013-02-13 00:15:40 -08:00
parent 69c06545ce
commit 121dc75451

View File

@ -35,7 +35,6 @@
#include <amxmodx> #include <amxmodx>
#include <amxmisc> #include <amxmisc>
new g_cmdLoopback[16]
new g_ResPtr new g_ResPtr
new g_HidePtr new g_HidePtr
@ -46,9 +45,6 @@ public plugin_init()
register_dictionary("common.txt") register_dictionary("common.txt")
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")
format(g_cmdLoopback, 15, "amxres%c%c%c%c", random_num('A', 'Z'), random_num('A', 'Z'), random_num('A', 'Z'), random_num('A', 'Z'))
register_clcmd(g_cmdLoopback, "ackSignal")
} }
public plugin_cfg() public plugin_cfg()
@ -67,15 +63,6 @@ public MapLoaded()
setVisibleSlots(players, maxplayers, limit) setVisibleSlots(players, maxplayers, limit)
} }
public ackSignal(id)
{
new lReason[64]
format(lReason, 63, "%L", id, "DROPPED_RES")
server_cmd("kick #%d ^"%s^"", get_user_userid(id), lReason)
return PLUGIN_HANDLED
}
public client_authorized(id) public client_authorized(id)
{ {
new maxplayers = get_maxplayers() new maxplayers = get_maxplayers()
@ -89,7 +76,9 @@ public client_authorized(id)
return PLUGIN_CONTINUE return PLUGIN_CONTINUE
} }
client_cmd(id, "%s", g_cmdLoopback) new lReason[64]
format(lReason, 63, "%L", id, "DROPPED_RES")
server_cmd("kick #%d ^"%s^"", get_user_userid(id), lReason)
return PLUGIN_HANDLED return PLUGIN_HANDLED
} }