Advertisement
Guest User

Untitled

a guest
Nov 11th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.54 KB | None | 0 0
  1. ////////// Grave Cross v2.0 Skin Mod /////
  2. // Grave Cross script by feindfluglp /////
  3. // Take Clothes script by Zabn ///////////
  4. // Clothes Drop modded in by Vampire /////
  5. // If you reuse this script please post //
  6. // Credits to Zabn and feindfluglp. //////
  7. //////////////////////////////////////////
  8.  
  9. private ["_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
  10. disableSerialization;
  11. if (deathHandled) exitWith {};
  12.  
  13. deathHandled = true;
  14.  
  15. // ################## grave cross parameter start ##################
  16. _magazines = call player_countmagazines;
  17. _backpack = unitBackpack player;
  18.  
  19. // ------------------items backpack check
  20. private ["_newBackpackType","_backpackWpn","_backpackMag"];
  21. dayz_myBackpack = unitBackpack player;
  22. _newBackpackType = (typeOf dayz_myBackpack);
  23. if(_newBackpackType != "") then {
  24. _backpackWpn = getWeaponCargo unitBackpack player;
  25. _backpackMag = getMagazineCargo unitBackpack player;
  26. };
  27. // ################## grave cross parameter stop ##################
  28.  
  29. //Death
  30. //Prevent client freezes
  31. _display = findDisplay 49;
  32. if(!isNull _display) then {_display closeDisplay 0;};
  33. if (dialog) then {closeDialog 0;};
  34. if (visibleMap) then {openMap false;};
  35.  
  36. _body = player;
  37. _playerID = getPlayerUID player;
  38. disableUserInput true;
  39. //add weapon on back to player...
  40. if (dayz_onBack != "") then {
  41. _body addWeapon dayz_onBack;
  42. };
  43. //Send Death Notice
  44. //["PVDZ_plr_Death",[dayz_characterID,0,_body,_playerID,dayz_playerName]] call callRpcProcedure;
  45. PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID];
  46. publicVariableServer "PVDZ_plr_Death";
  47.  
  48. _id = [player,20,true,getPosATL player] call player_alertZombies;
  49.  
  50. sleep 0.5;
  51.  
  52. player setDamage 1;
  53. 0.1 fadeSound 0;
  54.  
  55. player setVariable ["NORRN_unconscious", false, true];
  56. player setVariable ["unconsciousTime", 0, true];
  57. player setVariable ["USEC_isCardiac",false,true];
  58. player setVariable ["medForceUpdate",true,true];
  59. //remove combat timer on death
  60. player setVariable ["startcombattimer", 0];
  61. r_player_unconscious = false;
  62. r_player_cardiac = false;
  63.  
  64.  
  65. _array = _this;
  66. if (count _array > 0) then {
  67. _source = _array select 0;
  68. _method = _array select 1;
  69. if ((!isNull _source) and (_source != player)) then {
  70. _canHitFree = player getVariable ["freeTarget",false];
  71. _isBandit = (player getVariable["humanity",0]) <= -2000;
  72. _punishment = _canHitFree or _isBandit; //if u are bandit or start first - player will not recieve humanity drop
  73. _humanityHit = 0;
  74. if (!_punishment) then {
  75. //i'm "not guilty" - kill me and be punished
  76. _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
  77. _humanityHit = -(2000 - _myKills);
  78. _kills = _source getVariable ["humanKills",0];
  79. _source setVariable ["humanKills",(_kills + 1),true];
  80. PVDZ_send = [_source,"Humanity",[_source,_humanityHit,300]];
  81. publicVariableServer "PVDZ_send";
  82. } else {
  83. //i'm "guilty" - kill me as bandit
  84. _killsV = _source getVariable ["banditKills",0];
  85. _source setVariable ["banditKills",(_killsV + 1),true];
  86. };
  87. };
  88. _body setVariable ["deathType",_method,true];
  89. };
  90.  
  91. terminate dayz_musicH;
  92. //terminate dayz_lootCheck;
  93. terminate dayz_slowCheck;
  94. terminate dayz_animalCheck;
  95. terminate dayz_monitor1;
  96. terminate dayz_medicalH;
  97. terminate dayz_gui;
  98. //terminate dayz_zedCheck;
  99. terminate dayz_locationCheck;
  100. //terminate dayz_combatCheck;
  101. //terminate dayz_spawnCheck;
  102.  
  103. //Reset (just in case)
  104. //deleteVehicle dayz_playerTrigger;
  105. //disableUserInput false;
  106. r_player_dead = true;
  107.  
  108. "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;
  109.  
  110. "colorCorrections" ppEffectEnable true;
  111. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01], [1, 1, 1, 0.0]];
  112. "colorCorrections" ppEffectCommit 1;
  113.  
  114. //Player is Dead!
  115. 3 fadeSound 0;
  116. sleep 1;
  117.  
  118. dayz_originalPlayer enableSimulation true;
  119.  
  120. addSwitchableUnit dayz_originalPlayer;
  121. setPlayable dayz_originalPlayer;
  122. selectPlayer dayz_originalPlayer;
  123.  
  124. _myGroup = group _body;
  125. [_body] joinSilent dayz_firstGroup;
  126. deleteGroup _myGroup;
  127.  
  128. // ################## grave cross script start ##################
  129.  
  130. // --------------------player items setparameter
  131. _playerWeapons = weapons _body;
  132. _playerMagazines = _magazines;
  133. _playerSkin = (typeOf _body);
  134.  
  135.  
  136. // ############# script ##############
  137. removeAllWeapons _body;
  138. clearMagazineCargo _body;
  139. hidebody _body;
  140.  
  141. // --------------------Create a loot container inside the grave.
  142. _tempContainer = createVehicle ["weaponHolder", getPosATL _body, [], 0, "can_collide"];
  143. _containerLoc = getPosATL _tempContainer;
  144. _containerLoc = [((_containerLoc select 0) + 0),((_containerLoc select 1) + 0),0];
  145. _tempContainer setPosATL _containerLoc;
  146.  
  147.  
  148. // #### PLAYER items to weaponholder start ####
  149. // player add weapons
  150. {
  151. _tempContainer addWeaponCargoGlobal [_x,1];
  152. } forEach _playerWeapons;
  153.  
  154. // player add items
  155. {
  156. _tempContainer addMagazineCargoGlobal [_x,1];
  157. } forEach _playerMagazines;
  158.  
  159. // #### PLAYER items to weaponholder stop ####
  160.  
  161. // #### PLAYER skin to weaponsholder start ####
  162. switch (_playerSkin) do {
  163. case "Survivor3_DZ": {
  164. _playerSkin = "Survivor2_DZ";
  165. };
  166. case "Bandit1_DZ": {
  167. _playerSkin = "Survivor2_DZ";
  168. };
  169. };
  170.  
  171. _skinItem = "Skin_" + _playerSkin;
  172. _okSkin = isClass (configFile >> "CfgMagazines" >> _skinItem);
  173.  
  174. if(_okSkin) then {
  175. _tempContainer addMagazineCargoGlobal [_skinItem,1];
  176. };
  177. // #### PLAYER skin to weaponsholder stop ####
  178.  
  179. // #### BACKPACK items to weaponsholder start ####
  180.  
  181. if (!isNil "_newBackpackType") then {
  182. if (_newBackpackType != "") then {
  183. _backpackWpnTypes = [];
  184. _backpackWpnQtys = [];
  185. if (count _backpackWpn > 0) then {
  186. _backpackWpnTypes = _backpackWpn select 0;
  187. _backpackWpnQtys = _backpackWpn select 1;
  188. };
  189. _countr = 0;
  190. {
  191. _tempContainer addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
  192. _countr = _countr + 1;
  193. } forEach _backpackWpnTypes;
  194. _backpackmagTypes = [];
  195. _backpackmagQtys = [];
  196. if (count _backpackmag > 0) then {
  197. _backpackmagTypes = _backpackMag select 0;
  198. _backpackmagQtys = _backpackMag select 1;
  199. };
  200. _countr = 0;
  201. {
  202. _tempContainer addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
  203. _countr = _countr + 1;
  204. } forEach _backpackmagTypes;
  205. };
  206. };
  207. // #### BACKPACK items to weaponsholder stop ####
  208. // #### BACKPACK to weaponsholder start ####
  209. // help from opendayz: AlienX (simpler code)
  210. _allowedBackpacks = ["CZ_VestPouch_EP1", "DZ_Patrol_Pack_EP1", "DZ_Assault_Pack_EP1", "DZ_CivilBackpack_EP1",
  211. "DZ_ALICE_Pack_EP1", "DZ_Backpack_EP1", "DZ_British_ACU", "DZ_Czech_Vest_Puch",
  212. "DZ_GunBag_EP1", "DZ_TerminalPack_EP1", "DZ_TK_Assault_Pack_EP1", "DZ_LargeGunBag_EP1"];
  213.  
  214. _class = typeOf _backpack;
  215. if (_class in _allowedBackpacks) then { createVehicle [_class, position _body, [], 4, "can_collide"]; };
  216.  
  217. // #### BACKPACK to weaponsholder stop ####
  218.  
  219. // ### PERMALOOT start ###
  220. _tempContainer setVariable["permaLoot", true];
  221. // ### PERMALOOT stop ###
  222.  
  223.  
  224. // --------------------Create the tombstone objects.
  225. _graveBase = createVehicle ["GraveCross2", position _tempContainer, [], 0, "NO_COLLIDE"];
  226. _graveBase setPosATL position _tempContainer; // setPos again because arma.
  227. _graveBase setDir _playerDir;
  228.  
  229. [_graveBase, _tempContainer] spawn {
  230. };
  231. hidebody _body;
  232. // ################## grave cross script stop ##################
  233.  
  234. 3 cutRsc ["default", "PLAIN",3];
  235. 4 cutRsc ["default", "PLAIN",3];
  236.  
  237. _body setVariable["combattimeout", 0, true];
  238.  
  239. //["dayzFlies",player] call broadcastRpcCallAll;
  240. sleep 2;
  241.  
  242. 1 cutRsc ["DeathScreen_DZ","BLACK OUT",3];
  243.  
  244. playMusic "dayz_track_death_1";
  245.  
  246. "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
  247. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
  248.  
  249. sleep 2;
  250.  
  251. for "_x" from 5 to 1 step -1 do {
  252. titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
  253. sleep 1;
  254. };
  255.  
  256. PVDZ_Server_Simulation = [_body, false];
  257. publicVariableServer "PVDZ_Server_Simulation";
  258.  
  259. endMission "END1";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement