mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-19 02:51:51 +00:00
1.3.0e
- 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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user