Updating pawn's HP on slap
This commit is contained in:
parent
5991f85919
commit
c8c0a3f0ba
1 changed files with 2 additions and 0 deletions
|
|
@ -2,6 +2,7 @@
|
|||
using CounterStrikeSharp.API.Modules.Admin;
|
||||
using CounterStrikeSharp.API.Modules.Utils;
|
||||
using System.Text;
|
||||
using CounterStrikeSharp.API;
|
||||
|
||||
namespace CS2_SimpleAdmin;
|
||||
|
||||
|
|
@ -115,6 +116,7 @@ public static class PlayerUtils
|
|||
return;
|
||||
|
||||
pawn.Health -= damage;
|
||||
Utilities.SetStateChanged(pawn, "CBaseEntity", "m_iHealth");
|
||||
|
||||
if (pawn.Health <= 0)
|
||||
pawn.CommitSuicide(true, true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue