mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-18 18:49:23 +00:00
Better duration check
This commit is contained in:
@@ -382,16 +382,19 @@ namespace CS2_SimpleAdmin
|
|||||||
{
|
{
|
||||||
bool validCaller = caller != null && caller.IsValid;
|
bool validCaller = caller != null && caller.IsValid;
|
||||||
|
|
||||||
if (duration > Config.MaxBanDuration)
|
bool canPermBan = validCaller && AdminManager.PlayerHasPermissions(caller, "@css/permban");
|
||||||
|
|
||||||
|
if (duration > Config.MaxBanDuration && canPermBan == false)
|
||||||
{
|
{
|
||||||
if (validCaller)
|
if (validCaller)
|
||||||
caller.PrintToChat($"[Simple Admin] Ban duration cannot exceed {Config.MaxBanDuration} minutes.");
|
caller.PrintToChat($"[Simple Admin] Ban duration cannot exceed {Config.MaxBanDuration} minutes.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (duration == 0 && validCaller && AdminManager.PlayerHasPermissions(caller, "@css/permban") == false)
|
if (duration == 0 && canPermBan == false)
|
||||||
{
|
{
|
||||||
caller.PrintToChat($"[Simple Admin] You do not have the right to permanently ban.");
|
if (validCaller)
|
||||||
|
caller.PrintToChat($"[Simple Admin] You do not have the right to permanently ban.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user