Introduce enum structs to core sm plugins
This commit is contained in:
+11
-12
@@ -33,7 +33,7 @@
|
||||
|
||||
void PrepareBan(int client, int target, int time, const char[] reason)
|
||||
{
|
||||
int originalTarget = GetClientOfUserId(g_BanTargetUserId[client]);
|
||||
int originalTarget = GetClientOfUserId(playerinfo[client].banTargetUserId);
|
||||
|
||||
if (originalTarget != target)
|
||||
{
|
||||
@@ -106,7 +106,7 @@ void DisplayBanTimeMenu(int client)
|
||||
Menu menu = new Menu(MenuHandler_BanTimeList);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T: %N", "Ban player", client, g_BanTarget[client]);
|
||||
Format(title, sizeof(title), "%T: %N", "Ban player", client, playerinfo[client].banTarget);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
|
||||
@@ -126,7 +126,7 @@ void DisplayBanReasonMenu(int client)
|
||||
Menu menu = new Menu(MenuHandler_BanReasonList);
|
||||
|
||||
char title[100];
|
||||
Format(title, sizeof(title), "%T: %N", "Ban reason", client, g_BanTarget[client]);
|
||||
Format(title, sizeof(title), "%T: %N", "Ban reason", client, playerinfo[client].banTarget);
|
||||
menu.SetTitle(title);
|
||||
menu.ExitBackButton = true;
|
||||
|
||||
@@ -163,7 +163,7 @@ public void AdminMenu_Ban(TopMenu topmenu,
|
||||
int maxlength)
|
||||
{
|
||||
//Reset chat reason first
|
||||
g_IsWaitingForChatReason[param] = false;
|
||||
playerinfo[param].isWaitingForChatReason = false;
|
||||
|
||||
if (action == TopMenuAction_DisplayOption)
|
||||
{
|
||||
@@ -193,7 +193,7 @@ public int MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, i
|
||||
if(param2 == 0)
|
||||
{
|
||||
//Chat reason
|
||||
g_IsWaitingForChatReason[param1] = true;
|
||||
playerinfo[param1].isWaitingForChatReason = true;
|
||||
PrintToChat(param1, "[SM] %t", "Custom ban reason explanation", "sm_abortban");
|
||||
}
|
||||
else
|
||||
@@ -202,7 +202,7 @@ public int MenuHandler_BanReasonList(Menu menu, MenuAction action, int param1, i
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
|
||||
PrepareBan(param1, g_BanTarget[param1], g_BanTime[param1], info);
|
||||
PrepareBan(param1, playerinfo[param1].banTarget, playerinfo[param1].banTime, info);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -238,8 +238,8 @@ public int MenuHandler_BanPlayerList(Menu menu, MenuAction action, int param1, i
|
||||
}
|
||||
else
|
||||
{
|
||||
g_BanTarget[param1] = target;
|
||||
g_BanTargetUserId[param1] = userid;
|
||||
playerinfo[param1].banTarget = target;
|
||||
playerinfo[param1].banTargetUserId = userid;
|
||||
DisplayBanTimeMenu(param1);
|
||||
}
|
||||
}
|
||||
@@ -263,7 +263,7 @@ public int MenuHandler_BanTimeList(Menu menu, MenuAction action, int param1, int
|
||||
char info[32];
|
||||
|
||||
menu.GetItem(param2, info, sizeof(info));
|
||||
g_BanTime[param1] = StringToInt(info);
|
||||
playerinfo[param1].banTime = StringToInt(info);
|
||||
|
||||
DisplayBanReasonMenu(param1);
|
||||
}
|
||||
@@ -309,10 +309,9 @@ public Action Command_Ban(int client, int args)
|
||||
Arguments[0] = '\0';
|
||||
}
|
||||
|
||||
playerinfo[client].banTargetUserId = GetClientUserId(target);
|
||||
|
||||
int time = StringToInt(s_time);
|
||||
|
||||
g_BanTargetUserId[client] = GetClientUserId(target);
|
||||
|
||||
PrepareBan(client, target, time, Arguments[len]);
|
||||
|
||||
return Plugin_Handled;
|
||||
|
||||
Reference in New Issue
Block a user