Advertisement
Guest User

j0k3r5

a guest
Nov 11th, 2013
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.73 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.  
  10.  
  11.  
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18.  
  19. private ["_display","_body","_playerID","_array","_source","_method","_canHitFree","_isBandit","_punishment","_humanityHit","_myKills","_humanity","_kills","_killsV","_myGroup"];
  20. disableSerialization;
  21. if (deathHandled) exitWith {};
  22.  
  23. deathHandled = true;
  24.  
  25. // #################################### grave cross script start ####################################
  26.  
  27. // --------------------player items setparameter
  28. _playerWeapons = weapons _body;
  29. _playerMagazines = getMagazineCargo _body;
  30.  
  31.  
  32. // #################################### script ####################################
  33. removeAllWeapons _body;
  34. clearMagazineCargo _body;
  35. hidebody _body;
  36.  
  37. // --------------------Create the tombstone objects.
  38. _graveBase = createVehicle ["GraveCrossHelmet_EP1", position _body, [], 0, "NO_COLLIDE"];
  39. _graveBase setPosATL position _body; // setPos again because arma.
  40. _graveBase setDir _playerDir;
  41.  
  42. // --------------------Create a loot container inside the grave.
  43. _tempContainer = createVehicle ["weaponHolder", getPosATL _graveBase, [], 0, "can_collide"];
  44. _containerLoc = getPosATL _tempContainer;
  45. _containerLoc = [((_containerLoc select 0) + 0),((_containerLoc select 1) + 0),0];
  46. _tempContainer setPosATL _containerLoc;
  47.  
  48.  
  49. // #### PLAYER items to weaponholder start ####
  50. // player add weapons
  51. {
  52. _tempContainer addWeaponCargoGlobal [_x,1];
  53. } forEach _playerWeapons;
  54.  
  55. // player add items
  56. {
  57. _tempContainer addMagazineCargoGlobal [_x,1];
  58. } forEach _playerMagazines;
  59.  
  60. // #### PLAYER items to weaponholder stop ####
  61.  
  62.  
  63. // #### BACKPACK items to weaponsholder start ####
  64.  
  65. if (!isNil "_newBackpackType") then {
  66. if (_newBackpackType != "") then {
  67. _backpackWpnTypes = [];
  68. _backpackWpnQtys = [];
  69. if (count _backpackWpn > 0) then {
  70. _backpackWpnTypes = _backpackWpn select 0;
  71. _backpackWpnQtys = _backpackWpn select 1;
  72. };
  73. _countr = 0;
  74. {
  75. _tempContainer addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
  76. _countr = _countr + 1;
  77. } forEach _backpackWpnTypes;
  78. _backpackmagTypes = [];
  79. _backpackmagQtys = [];
  80. if (count _backpackmag > 0) then {
  81. _backpackmagTypes = _backpackMag select 0;
  82. _backpackmagQtys = _backpackMag select 1;
  83. };
  84. _countr = 0;
  85. {
  86. _tempContainer addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
  87. _countr = _countr + 1;
  88. } forEach _backpackmagTypes;
  89. };
  90. };
  91. // #### BACKPACK items to weaponsholder stop ####
  92.  
  93.  
  94. // #### BACKPACK to weaponsholder start ####
  95.  
  96.  
  97. // ### vanilla dayz ###
  98. _class = typeOf _backpack;
  99. if (_class == "CZ_VestPouch_EP1") then {createVehicle ["CZ_VestPouch_EP1", position _body, [], 2, "can_collide"];};
  100. _class = typeOf _backpack;
  101. if (_class == "DZ_Patrol_Pack_EP1") then {createVehicle ["DZ_Patrol_Pack_EP1", position _body, [], 2, "can_collide"];};
  102. _class = typeOf _backpack;
  103. if (_class == "DZ_Assault_Pack_EP1") then {createVehicle ["DZ_Assault_Pack_EP1", position _body, [], 2, "can_collide"];};
  104. _class = typeOf _backpack;
  105. if (_class == "DZ_CivilBackpack_EP1") then {createVehicle ["DZ_CivilBackpack_EP1", position _body, [], 2, "can_collide"];};
  106. _class = typeOf _backpack;
  107. if (_class == "DZ_ALICE_Pack_EP1") then {createVehicle ["DZ_ALICE_Pack_EP1", position _body, [], 2, "can_collide"];};
  108. _class = typeOf _backpack;
  109. if (_class == "DZ_Backpack_EP1") then {createVehicle ["DZ_Backpack_EP1", position _body, [], 2, "can_collide"];};
  110. _class = typeOf _backpack;
  111. if (_class == "DZ_British_ACU") then {createVehicle ["DZ_British_ACU", position _body, [], 2, "can_collide"];};
  112. _class = typeOf _backpack;
  113. if (_class == "DZ_Czech_Vest_Puch") then {createVehicle ["DZ_Czech_Vest_Puch", position _body, [], 2, "can_collide"];};
  114.  
  115.  
  116. [_graveBase, _tempContainer] spawn {
  117. };
  118. hideBody _body;
  119.  
  120. // #################################### grave cross script stop ####################################
  121.  
  122. //Death
  123. //Prevent client freezes
  124. _display = findDisplay 49;
  125. if(!isNull _display) then {_display closeDisplay 0;};
  126. if (dialog) then {closeDialog 0;};
  127. if (visibleMap) then {openMap false;};
  128.  
  129. _body = player;
  130. _playerID = getPlayerUID player;
  131. disableUserInput true;
  132. //add weapon on back to player...
  133. if (dayz_onBack != "") then {
  134. _body addWeapon dayz_onBack;
  135. };
  136. //Send Death Notice
  137. //["PVDZ_plr_Death",[dayz_characterID,0,_body,_playerID,dayz_playerName]] call callRpcProcedure;
  138. PVDZ_plr_Death = [dayz_characterID,0,_body,_playerID];
  139. publicVariableServer "PVDZ_plr_Death";
  140.  
  141. _id = [player,20,true,getPosATL player] call player_alertZombies;
  142.  
  143. sleep 0.5;
  144.  
  145. player setDamage 1;
  146. 0.1 fadeSound 0;
  147.  
  148. player setVariable ["NORRN_unconscious", false, true];
  149. player setVariable ["unconsciousTime", 0, true];
  150. player setVariable ["USEC_isCardiac",false,true];
  151. player setVariable ["medForceUpdate",true,true];
  152. //remove combat timer on death
  153. player setVariable ["startcombattimer", 0];
  154. r_player_unconscious = false;
  155. r_player_cardiac = false;
  156.  
  157.  
  158. _array = _this;
  159. if (count _array > 0) then {
  160. _source = _array select 0;
  161. _method = _array select 1;
  162. if ((!isNull _source) and (_source != player)) then {
  163. _canHitFree = player getVariable ["freeTarget",false];
  164. _isBandit = (player getVariable["humanity",0]) <= -2000;
  165. _punishment = _canHitFree or _isBandit; //if u are bandit or start first - player will not recieve humanity drop
  166. _humanityHit = 0;
  167. if (!_punishment) then {
  168. //i'm "not guilty" - kill me and be punished
  169. _myKills = ((player getVariable ["humanKills",0]) / 30) * 1000;
  170. _humanityHit = -(2000 - _myKills);
  171. _kills = _source getVariable ["humanKills",0];
  172. _source setVariable ["humanKills",(_kills + 1),true];
  173. PVDZ_send = [_source,"Humanity",[_source,_humanityHit,300]];
  174. publicVariableServer "PVDZ_send";
  175. } else {
  176. //i'm "guilty" - kill me as bandit
  177. _killsV = _source getVariable ["banditKills",0];
  178. _source setVariable ["banditKills",(_killsV + 1),true];
  179. };
  180. };
  181. _body setVariable ["deathType",_method,true];
  182. };
  183.  
  184. terminate dayz_musicH;
  185. //terminate dayz_lootCheck;
  186. terminate dayz_slowCheck;
  187. terminate dayz_animalCheck;
  188. terminate dayz_monitor1;
  189. terminate dayz_medicalH;
  190. terminate dayz_gui;
  191. //terminate dayz_zedCheck;
  192. terminate dayz_locationCheck;
  193. //terminate dayz_combatCheck;
  194. //terminate dayz_spawnCheck;
  195.  
  196. //Reset (just in case)
  197. //deleteVehicle dayz_playerTrigger;
  198. //disableUserInput false;
  199. r_player_dead = true;
  200.  
  201. "dynamicBlur" ppEffectEnable true;"dynamicBlur" ppEffectAdjust [4]; "dynamicBlur" ppEffectCommit 0.2;
  202.  
  203. "colorCorrections" ppEffectEnable true;
  204. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.01], [1, 1, 1, 0.0]];
  205. "colorCorrections" ppEffectCommit 1;
  206.  
  207. //Player is Dead!
  208. 3 fadeSound 0;
  209. sleep 1;
  210.  
  211. dayz_originalPlayer enableSimulation true;
  212.  
  213. addSwitchableUnit dayz_originalPlayer;
  214. setPlayable dayz_originalPlayer;
  215. selectPlayer dayz_originalPlayer;
  216.  
  217. _myGroup = group _body;
  218. [_body] joinSilent dayz_firstGroup;
  219. deleteGroup _myGroup;
  220.  
  221.  
  222.  
  223. // #################################### grave cross script start ####################################
  224.  
  225. // --------------------player items setparameter
  226. _playerWeapons = weapons _body;
  227. _playerMagazines = _magazines;
  228. _playerSkin = (typeOf _body);
  229.  
  230.  
  231. // ############# script ##############
  232. removeAllWeapons _body;
  233. clearMagazineCargo _body;
  234. hidebody _body;
  235.  
  236. // --------------------Create a loot container inside the grave.
  237. _tempContainer = createVehicle ["weaponHolder", getPosATL _body, [], 0, "can_collide"];
  238. _containerLoc = getPosATL _tempContainer;
  239. _containerLoc = [((_containerLoc select 0) + 0),((_containerLoc select 1) + 0),0];
  240. _tempContainer setPosATL _containerLoc;
  241.  
  242.  
  243. // #### PLAYER items to weaponholder start ####
  244. // player add weapons
  245. {
  246. _tempContainer addWeaponCargoGlobal [_x,1];
  247. } forEach _playerWeapons;
  248.  
  249. // player add items
  250. {
  251. _tempContainer addMagazineCargoGlobal [_x,1];
  252. } forEach _playerMagazines;
  253.  
  254. // #### PLAYER items to weaponholder stop ####
  255.  
  256. // #### PLAYER skin to weaponsholder start ####
  257. switch (_playerSkin) do {
  258. case "Survivor3_DZ": {
  259. _playerSkin = "Survivor2_DZ";
  260. };
  261. case "Bandit1_DZ": {
  262. _playerSkin = "Survivor2_DZ";
  263. };
  264. };
  265.  
  266. _skinItem = "Skin_" + _playerSkin;
  267. _okSkin = isClass (configFile >> "CfgMagazines" >> _skinItem);
  268.  
  269. if(_okSkin) then {
  270. _tempContainer addMagazineCargoGlobal [_skinItem,1];
  271. };
  272. // #### PLAYER skin to weaponsholder stop ####
  273.  
  274. // #### BACKPACK items to weaponsholder start ####
  275.  
  276. if (!isNil "_newBackpackType") then {
  277. if (_newBackpackType != "") then {
  278. _backpackWpnTypes = [];
  279. _backpackWpnQtys = [];
  280. if (count _backpackWpn > 0) then {
  281. _backpackWpnTypes = _backpackWpn select 0;
  282. _backpackWpnQtys = _backpackWpn select 1;
  283. };
  284. _countr = 0;
  285. {
  286. _tempContainer addWeaponCargoGlobal [_x,(_backpackWpnQtys select _countr)];
  287. _countr = _countr + 1;
  288. } forEach _backpackWpnTypes;
  289. _backpackmagTypes = [];
  290. _backpackmagQtys = [];
  291. if (count _backpackmag > 0) then {
  292. _backpackmagTypes = _backpackMag select 0;
  293. _backpackmagQtys = _backpackMag select 1;
  294. };
  295. _countr = 0;
  296. {
  297. _tempContainer addmagazineCargoGlobal [_x,(_backpackmagQtys select _countr)];
  298. _countr = _countr + 1;
  299. } forEach _backpackmagTypes;
  300. };
  301. };
  302. // #### BACKPACK items to weaponsholder stop ####
  303. // #### BACKPACK to weaponsholder start ####
  304. // help from opendayz: AlienX (simpler code)
  305. _allowedBackpacks = ["CZ_VestPouch_EP1", "DZ_Patrol_Pack_EP1", "DZ_Assault_Pack_EP1", "DZ_CivilBackpack_EP1",
  306. "DZ_ALICE_Pack_EP1", "DZ_Backpack_EP1", "DZ_British_ACU", "DZ_Czech_Vest_Puch"];
  307.  
  308. _class = typeOf _backpack;
  309. if (_class in _allowedBackpacks) then { createVehicle [_class, position _body, [], 4, "can_collide"]; };
  310.  
  311. // #### BACKPACK to weaponsholder stop ####
  312.  
  313. // ### PERMALOOT start ###
  314. _tempContainer setVariable["permaLoot", true];
  315. // ### PERMALOOT stop ###
  316.  
  317.  
  318. // --------------------Create the tombstone objects.
  319. _graveBase = createVehicle ["GraveCrossHelmet_EP1", position _tempContainer, [], 0, "NO_COLLIDE"];
  320. _graveBase setPosATL position _tempContainer; // setPos again because arma.
  321. _graveBase setDir _playerDir;
  322.  
  323. [_graveBase, _tempContainer] spawn {
  324. };
  325. hidebody _body;
  326. // #################################### grave cross script stop ####################################
  327.  
  328.  
  329.  
  330.  
  331.  
  332.  
  333.  
  334. 3 cutRsc ["default", "PLAIN",3];
  335. 4 cutRsc ["default", "PLAIN",3];
  336.  
  337. _body setVariable["combattimeout", 0, true];
  338.  
  339. //["dayzFlies",player] call broadcastRpcCallAll;
  340. sleep 2;
  341.  
  342. 1 cutRsc ["DeathScreen_DZ","BLACK OUT",3];
  343.  
  344. playMusic "dayz_track_death_1";
  345.  
  346. "dynamicBlur" ppEffectAdjust [0]; "dynamicBlur" ppEffectCommit 5;
  347. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 1], [1, 1, 1, 1]];"colorCorrections" ppEffectCommit 5;
  348.  
  349. sleep 2;
  350.  
  351. for "_x" from 5 to 1 step -1 do {
  352. titleText [format[localize "str_return_lobby", _x], "PLAIN DOWN", 1];
  353. sleep 1;
  354. };
  355.  
  356. PVDZ_Server_Simulation = [_body, false];
  357. publicVariableServer "PVDZ_Server_Simulation";
  358.  
  359. endMission "END1";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement