mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-09-27 20:17:04 +02:00
Better duration check
This commit is contained in:
parent
fb251aadef
commit
a0b2e59357
1 changed files with 6 additions and 3 deletions
|
|
@ -382,15 +382,18 @@ 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)
|
||||||
{
|
{
|
||||||
|
if (validCaller)
|
||||||
caller.PrintToChat($"[Simple Admin] You do not have the right to permanently ban.");
|
caller.PrintToChat($"[Simple Admin] You do not have the right to permanently ban.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue