DayZ 1.24
Loading...
Searching...
No Matches
PlateCarrierVest.c
Go to the documentation of this file.
2{
3 override void OnWasAttached(EntityAI parent, int slot_id)
4 {
5 super.OnWasAttached(parent, slot_id);
6
7 if (GetGame().IsServer() && parent.IsInherited(DayZInfected))
8 {
9 float coef = Math.RandomFloatInclusive(0.2, 0.4);
10 SetHealth01("", "", coef);
11 }
12 }
13
14 //Debug menu Spawn Ground Special
15 override void OnDebugSpawn()
16 {
18 if (Class.CastTo(entity, this))
19 {
20 entity.GetInventory().CreateInInventory("PlateCarrierPouches");
21 entity.GetInventory().CreateInInventory("PlateCarrierHolster");
22 }
23 }
24};
Super root of all classes in Enforce script.
Definition EnScript.c:11
Definition EnMath.c:7
override void OnWasAttached(EntityAI parent, int slot_id)
override void OnDebugSpawn()
proto native CGame GetGame()
static proto bool CastTo(out Class to, Class from)
Try to safely down-cast base class to child class.
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
Definition EnMath.c:106