Fixed amb1918 - Ban menu should compare userids, not client indexes

--HG--
extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402436
This commit is contained in:
Matt Woodrow 2008-08-07 23:16:16 +00:00
parent a01848c774
commit eaccf6f90b
2 changed files with 10 additions and 0 deletions

View File

@ -49,6 +49,7 @@ public Plugin:myinfo =
new Handle:hTopMenu = INVALID_HANDLE;
new g_BanTarget[MAXPLAYERS+1];
new g_BanTargetUserId[MAXPLAYERS+1];
new g_BanTime[MAXPLAYERS+1];
#include "basebans/ban.sp"

View File

@ -33,6 +33,14 @@
PrepareBan(client, target, time, const String:reason[])
{
new originalTarget = GetClientOfUserId(g_BanTargetUserId[client]);
if (originalTarget != target)
{
PrintToChat(client, "[SM] %t", "Player no longer available");
return;
}
decl String:authid[64], String:name[32];
GetClientAuthString(target, authid, sizeof(authid));
GetClientName(target, name, sizeof(name));
@ -200,6 +208,7 @@ public MenuHandler_BanPlayerList(Handle:menu, MenuAction:action, param1, param2)
else
{
g_BanTarget[param1] = target;
g_BanTargetUserId[param1] = userid;
DisplayBanTimeMenu(param1);
}
}