Advertisement
Guest User

Untitled

a guest
Apr 29th, 2014
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. private ["_hasKnife","_qty","_item","_text","_string","_type","_started","_finished","_animState","_isMedic","_hasHarvested","_hasKnifeBlunt","_humanity"];
  2.  
  3. if(DZE_ActionInProgress) exitWith { cutText [(localize "str_epoch_player_31") , "PLAIN DOWN"]; };
  4. DZE_ActionInProgress = true;
  5.  
  6. player removeAction s_player_butcher;
  7. s_player_butcher = 1;
  8.  
  9. _item = _this select 3;
  10. _hasKnife = "ItemKnife" in items player;
  11. _hasKnifeBlunt = "ItemKnifeBlunt" in items player;
  12. _type = typeOf _item;
  13. _hasHarvested = _item getVariable["meatHarvested",false];
  14. //_config = configFile >> "CfgSurvival" >> "Meat" >> _type;
  15.  
  16. if ((_hasKnife or _hasKnifeBlunt) and !_hasHarvested) then {
  17. //Get Animal Type
  18. //_loop = true;
  19. //_isListed = isClass (_config);
  20. _text = getText (configFile >> "CfgVehicles" >> _type >> "displayName");
  21.  
  22. [1,1] call dayz_HungerThirst;
  23. // force animation
  24. player playActionNow "Medic";
  25.  
  26. // Alert zombies
  27. [player,50,true,(getPosATL player)] spawn player_alertZombies;
  28.  
  29. r_interrupt = false;
  30. _animState = animationState player;
  31. r_doLoop = true;
  32. _started = false;
  33. _finished = false;
  34.  
  35. while {r_doLoop} do {
  36. _animState = animationState player;
  37. _isMedic = ["medic",_animState] call fnc_inString;
  38. if (_isMedic) then {
  39. _started = true;
  40. };
  41. if (_started and !_isMedic) then {
  42. r_doLoop = false;
  43. _finished = true;
  44. };
  45. if (r_interrupt) then {
  46. r_doLoop = false;
  47. };
  48. sleep 0.1;
  49. };
  50. r_doLoop = false;
  51.  
  52. if (!_finished) exitWith {
  53. r_interrupt = false;
  54. if (vehicle player == player) then {
  55. [objNull, player, rSwitchMove,""] call RE;
  56. player playActionNow "stop";
  57. };
  58. cutText [(localize "str_epoch_player_30") , "PLAIN DOWN"];
  59. //_abort = true;
  60. };
  61.  
  62. _hasHarvested = _item getVariable["meatHarvested",false];
  63.  
  64. if(_finished and !_hasHarvested) then {
  65.  
  66. _item setVariable["meatHarvested",true,true];
  67.  
  68. // Play sound since we finished
  69. [player,"gut",0,false,10] call dayz_zombieSpeak;
  70.  
  71. _qty = 1;
  72. if (local _item) then {
  73. [_item,_qty] spawn local_gutObjectZ;
  74. } else {
  75. //Leave this as PV instead of PVS/PVC - Skaronator
  76. //Also not sure if we need this
  77. PVDZE_plr_GutBodyZ = [_item,_qty];
  78. publicVariable "PVDZE_plr_GutBodyZ";
  79. };
  80.  
  81. // Reduce humanity for gutting zeds
  82. _humanity = player getVariable["humanity",0];
  83. _humanity = _humanity - 10;
  84. player setVariable["humanity",_humanity,true];
  85.  
  86.  
  87. _string = format["Successfully Gutted Zombie",_text,_qty];
  88. cutText [_string, "PLAIN DOWN"];
  89. };
  90. };
  91. s_player_butcher = -1;
  92. DZE_ActionInProgress = false;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement