Advertisement
Guest User

bloodbag.sqf

a guest
Jan 28th, 2013
291
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.62 KB | None | 0 0
  1. // bleed.sqf
  2. _unit = (_this select 3) select 0;
  3. _lowBlood = _unit getVariable ["USEC_lowBlood", false];
  4. _injured = _unit getVariable ["USEC_injured", false];
  5. _inPain = _unit getVariable ["USEC_inPain", false];
  6.  
  7. player removeAction s_player_cook2;
  8. s_player_cook2 = -1;
  9.  
  10. if (vehicle player == player) then {
  11. //not in a vehicle
  12. player playActionNow "Medic";
  13. };
  14. r_interrupt = false;
  15. _animState = animationState player;
  16. r_doLoop = true;
  17. _started = false;
  18. _finished = false;
  19. while {r_doLoop} do {
  20. _animState = animationState player;
  21. _isMedic = ["medic",_animState] call fnc_inString;
  22. if (_isMedic) then {
  23. _started = true;
  24. };
  25. if (_started and !_isMedic) then {
  26. r_doLoop = false;
  27. _finished = true;
  28. };
  29. if (r_interrupt) then {
  30. r_doLoop = false;
  31. };
  32. sleep 0.1;
  33. };
  34. r_doLoop = false;
  35.  
  36. if (_finished) then {
  37. if (_unit == player) then {
  38. //Self Healing
  39. _id = [player,player] execVM "\z\addons\dayz_code\medical\publicEH\medTransfuse.sqf";
  40. } else {
  41. dayzHumanity = [player,50];
  42. _id = dayzHumanity spawn player_humanityChange;
  43. };
  44.  
  45. _unit setVariable["USEC_lowBlood",false,true];
  46. player removeMagazine "ItemBloodbag";
  47. usecTransfuse = [_unit,player];
  48. publicVariable "usecTransfuse";
  49. } else {
  50. r_interrupt = false;
  51. [objNull, player, rSwitchMove,""] call RE;
  52. player playActionNow "stop";
  53. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement