Fix warnings

This commit is contained in:
2018-09-11 00:55:50 +02:00
parent 1d54e1b85a
commit 8cb89ab79d
5 changed files with 34 additions and 9 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -104,13 +104,38 @@ void DisplayBanTimeMenu(int client)
menu.SetTitle(title);
menu.ExitBackButton = true;
menu.AddItem("0", "Permanent");
menu.AddItem("10", "10 Minutes");
menu.AddItem("30", "30 Minutes");
menu.AddItem("60", "1 Hour");
menu.AddItem("240", "4 Hours");
menu.AddItem("1440", "1 Day");
menu.AddItem("10080", "1 Week");
int _iSize = LimitBan_GetSize();
if(!g_bLimitBan || !_iSize)
{
menu.AddItem("0", "Permanent");
menu.AddItem("10", "10 Minutes");
menu.AddItem("30", "30 Minutes");
menu.AddItem("60", "1 Hour");
menu.AddItem("240", "4 Hours");
menu.AddItem("1440", "1 Day");
menu.AddItem("10080", "1 Week");
}
else
{
char _sDisplay[64];
char _sLength[32];
for(int i = 0; i <= _iSize; i++)
{
if(LimitBan_GetAccess(i, client))
{
int _iLength = LimitBan_GetLength(i);
IntToString(_iLength, _sLength, sizeof(_sLength));
LimitBan_GetDisplay(i, _sDisplay);
AddMenuItem(menu, _sLength, _sDisplay);
}
}
if(LimitBan_GetAccess(-1, client))
{
LimitBan_GetDisplay(-1, _sDisplay);
AddMenuItem(menu, "0", _sDisplay);
}
}
menu.Display(client, MENU_TIME_FOREVER);
}

View File

@@ -122,7 +122,7 @@ public OnPluginStart()
LoadTranslations("common.phrases");
LoadTranslations("sm_limit_ban_duration.phrases");
CreateConVar("sm_limit_ban_duration_version", PLUGIN_VERSION, "Limit Ban Duration: Version", FCVAR_PLUGIN|FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
CreateConVar("sm_limit_ban_duration_version", PLUGIN_VERSION, "Limit Ban Duration: Version", FCVAR_SPONLY|FCVAR_REPLICATED|FCVAR_NOTIFY|FCVAR_DONTRECORD);
g_hEnabled = CreateConVar("sm_limit_ban_duration_enabled", "1", "Enables/disables all features of this plugin.", FCVAR_NONE, true, 0.0, true, 1.0);
HookConVarChange(g_hEnabled, OnSettingsChange);
@@ -331,7 +331,7 @@ Bool_IssueBan(client, index, const String:buffer[])
_iLength += BreakString(buffer[_iLength], _sBuffer, sizeof(_sBuffer));
strcopy(_sBuffer, sizeof(_sBuffer), buffer[_iLength]);
if(g_bSourceBans)
SBBanPlayer(client, _iTarget, g_iDurationLength[index], _sBuffer);
SourceBans_BanPlayer(client, _iTarget, g_iDurationLength[index], _sBuffer);
else
BanClient(_iTarget, g_iDurationLength[index], BANFLAG_AUTO, _sBuffer);
return true;