mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
Fun menu done without guns, need to test
This commit is contained in:
@@ -41,29 +41,15 @@ public static class PlayerExtensions
|
||||
public static void SetHp(this CCSPlayerController controller, int health = 100)
|
||||
{
|
||||
if (health <= 0 || !controller.PawnIsAlive || controller.PlayerPawn.Value == null) return;
|
||||
|
||||
controller.Health = health;
|
||||
|
||||
controller.PlayerPawn.Value.Health = health;
|
||||
|
||||
if (health > 100)
|
||||
{
|
||||
controller.MaxHealth = health;
|
||||
controller.PlayerPawn.Value.MaxHealth = health;
|
||||
}
|
||||
|
||||
CPlayer_WeaponServices? weaponServices = controller.PlayerPawn.Value!.WeaponServices;
|
||||
if (weaponServices == null) return;
|
||||
|
||||
controller.GiveNamedItem("weapon_healthshot");
|
||||
|
||||
foreach (var weapon in weaponServices.MyWeapons)
|
||||
{
|
||||
if (weapon != null && weapon.IsValid && weapon.Value!.DesignerName == "weapon_healthshot")
|
||||
{
|
||||
weapon.Value.Remove();
|
||||
break;
|
||||
}
|
||||
}
|
||||
Utilities.SetStateChanged(controller.PlayerPawn.Value, "CBaseEntity", "m_iHealth");
|
||||
}
|
||||
|
||||
public static void Bury(this CBasePlayerPawn pawn, float depth = 10f)
|
||||
|
||||
Reference in New Issue
Block a user