Small changes

- Small changes
- Added `ru` and `pt-br` lang
This commit is contained in:
Dawid Bepierszcz
2024-02-14 01:53:13 +01:00
parent 64803ebff2
commit 8e1a1b2ecf
24 changed files with 115 additions and 122 deletions

View File

@@ -386,4 +386,4 @@ namespace CS2_SimpleAdmin
command.ReplyToCommand($"Unbanned player with pattern {pattern}.");
}
}
}
}

View File

@@ -19,7 +19,7 @@ namespace CS2_SimpleAdmin
public void OnAdminToAdminSayCommand(CCSPlayerController? caller, CommandInfo command)
{
if (caller == null || !caller.IsValid || command.GetCommandString[command.GetCommandString.IndexOf(' ')..].Length == 0) return;
string callerName= caller == null ? "Console" : caller.PlayerName;
string callerName = caller == null ? "Console" : caller.PlayerName;
if (_discordWebhookClientLog != null && _localizer != null)
{
@@ -48,7 +48,7 @@ namespace CS2_SimpleAdmin
{
if (command.GetCommandString[command.GetCommandString.IndexOf(' ')..].Length == 0) return;
string callerName= caller == null ? "Console" : caller.PlayerName;
string callerName = caller == null ? "Console" : caller.PlayerName;
byte[] utf8BytesString = Encoding.UTF8.GetBytes(command.GetCommandString[command.GetCommandString.IndexOf(' ')..]);
string utf8String = Encoding.UTF8.GetString(utf8BytesString);
@@ -97,7 +97,7 @@ namespace CS2_SimpleAdmin
[RequiresPermissions("@css/chat")]
public void OnAdminCenterSayCommand(CCSPlayerController? caller, CommandInfo command)
{
string callerName= caller == null ? "Console" : caller.PlayerName;
string callerName = caller == null ? "Console" : caller.PlayerName;
byte[] utf8BytesString = Encoding.UTF8.GetBytes(command.GetCommandString[command.GetCommandString.IndexOf(' ')..]);
string utf8String = Encoding.UTF8.GetString(utf8BytesString);
@@ -115,7 +115,7 @@ namespace CS2_SimpleAdmin
[RequiresPermissions("@css/chat")]
public void OnAdminHudSayCommand(CCSPlayerController? caller, CommandInfo command)
{
string callerName= caller == null ? "Console" : caller.PlayerName;
string callerName = caller == null ? "Console" : caller.PlayerName;
byte[] utf8BytesString = Encoding.UTF8.GetBytes(command.GetCommandString[command.GetCommandString.IndexOf(' ')..]);
string utf8String = Encoding.UTF8.GetString(utf8BytesString);
@@ -131,4 +131,4 @@ namespace CS2_SimpleAdmin
0, 0, 0, 0);
}
}
}
}

View File

@@ -615,4 +615,4 @@ namespace CS2_SimpleAdmin
Server.ExecuteCommand("mp_restartgame 2");
}
}
}
}

View File

@@ -43,7 +43,6 @@ namespace CS2_SimpleAdmin
foreach (CCSPlayerController _player in Helper.GetValidPlayers())
{
using (new WithTemporaryCulture(_player.GetLanguage()))
{
Helper.PrintToCenterAll(_localizer!["sa_admin_vote_message", caller == null ? "Console" : caller.PlayerName, question]);
@@ -91,4 +90,4 @@ namespace CS2_SimpleAdmin
}
}
}
}
}

View File

@@ -152,4 +152,4 @@ namespace CS2_SimpleAdmin
}
}
}
}
}

View File

@@ -53,7 +53,6 @@ namespace CS2_SimpleAdmin
{
using (new WithTemporaryCulture(_player.GetLanguage()))
{
StringBuilder sb = new(_localizer!["sa_prefix"]);
sb.Append(_localizer["sa_admin_slay_message", callerName, player.PlayerName]);
_player.PrintToChat(sb.ToString());
@@ -118,11 +117,13 @@ namespace CS2_SimpleAdmin
player.GiveNamedItem(weapon);
SubGiveWeapon(caller, player, weapon.ToString(), callerName);
}
public void GiveWeapon(CCSPlayerController? caller, CCSPlayerController player, string weaponName, string? callerName = null)
{
player.GiveNamedItem(weaponName);
SubGiveWeapon(caller, player, weaponName, callerName);
}
public void SubGiveWeapon(CCSPlayerController? caller, CCSPlayerController player, string weaponName, string? callerName = null)
{
callerName ??= caller == null ? "Console" : caller.PlayerName;
@@ -338,7 +339,6 @@ namespace CS2_SimpleAdmin
godPlayers = new ConcurrentBag<int>(godPlayers.Where(item => item != player.Slot));
}
if (caller == null || caller != null && !silentPlayers.Contains(caller.Slot))
{
foreach (CCSPlayerController _player in Helper.GetValidPlayers())
@@ -603,7 +603,6 @@ namespace CS2_SimpleAdmin
}
}
}
}
[ConsoleCommand("css_tp", "Teleport to a player.")]
@@ -715,4 +714,4 @@ namespace CS2_SimpleAdmin
});
}
}
}
}