- Added `css_rename`
- Added `css_silence`
- Added `css_addsilence`
- Added `css_unsilence`
- PlayerPenaltyManager class
- Fix for invalid players

New commands localized only for `pl` and `en`, if u can please make pr for other languages
This commit is contained in:
Dawid Bepierszcz
2024-02-11 03:24:27 +01:00
parent 01ceb104c5
commit 79bbe0f4c5
9 changed files with 793 additions and 194 deletions

View File

@@ -109,6 +109,31 @@ public static class PlayerUtils
}
}
public static void Rename(this CCSPlayerController controller, string newName = "Unknown")
{
if (CS2_SimpleAdmin._plugin == null)
return;
SchemaString<CBasePlayerController> playerName = new SchemaString<CBasePlayerController>(controller, "m_iszPlayerName");
playerName.Set(newName + " ");
CS2_SimpleAdmin._plugin.AddTimer(0.25f, () =>
{
Utilities.SetStateChanged(controller, "CCSPlayerController", "m_szClan");
Utilities.SetStateChanged(controller, "CBasePlayerController", "m_iszPlayerName");
});
CS2_SimpleAdmin._plugin.AddTimer(0.3f, () =>
{
playerName.Set(newName);
});
CS2_SimpleAdmin._plugin.AddTimer(0.4f, () =>
{
Utilities.SetStateChanged(controller, "CBasePlayerController", "m_iszPlayerName");
});
}
private static void PerformSlap(CBasePlayerPawn pawn, int damage = 0)
{
if (pawn.LifeState != (int)LifeState_t.LIFE_ALIVE)