mirror of
https://github.com/daffyyyy/CS2-SimpleAdmin.git
synced 2026-02-17 18:39:07 +00:00
1.2.2a UPDATE
- Fixed css_addban, css_addmute - New command `css_hp` - New command `css_god` - New command `css_speed`
This commit is contained in:
@@ -25,6 +25,34 @@ public static class PlayerUtils
|
||||
return AdminManager.CanPlayerTarget(controller, target);
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
var 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void Bury(this CBasePlayerPawn pawn, float depth = 10f)
|
||||
{
|
||||
var newPos = new Vector(pawn.AbsOrigin!.X, pawn.AbsOrigin.Y,
|
||||
|
||||
Reference in New Issue
Block a user