DayZ Scripts
v1.21.156300 ยท Jun 20, 2023
 
Loading...
Searching...
No Matches
ActionBandageBase.c
Go to the documentation of this file.
2{
3
4 override bool ActionCondition( PlayerBase player, ActionTarget target, ItemBase item )
5 {
6 if( target)
7 {
8 PlayerBase target_player = PlayerBase.Cast(target.GetObject());
9 if(target_player)
10 return target_player.IsBleeding();
11 }
12 return player.IsBleeding();
13
14 }
15
16 void ApplyBandage( ItemBase item, PlayerBase player )
17 {
18 if (player.GetBleedingManagerServer() )
19 {
20 player.GetBleedingManagerServer().RemoveMostSignificantBleedingSourceEx(item);
21 }
22
23 PluginTransmissionAgents m_mta = PluginTransmissionAgents.Cast(GetPlugin(PluginTransmissionAgents));
24 m_mta.TransmitAgents(item, player, AGT_ITEM_TO_FLESH);
25
26 if (item.HasQuantity())
27 {
28 item.AddQuantity(-1,true);
29 }
30 else
31 {
32 item.Delete();
33 }
34 }
35};
class ActionTargets ActionTarget
PluginBase GetPlugin(typename plugin_type)
void ApplyBandage(ItemBase item, PlayerBase player)
override bool ActionCondition(PlayerBase player, ActionTarget target, ItemBase item)
const int AGT_ITEM_TO_FLESH
Definition constants.c:459