Advertisement
josema0890

player_spawn_2.sqf

May 26th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 20.38 KB | None | 0 0
  1. private["_timeOut","_messTimer","_lastSave","_lastTemp","_debug","_isBandit","_isHero","_refObj","_size","_vel","_speed","_saveTime","_randomSpot","_tempPos","_distance","_mylastPos","_isSync","_veh","_humanity","_isBandit3","_model","_isBandit2","_lastUpdate","_hunger","_thirst","_listTalk","_rnd","_foodVal","_thirstVal","_result","_id","_lowBlood","_display","_control","_headShots","_kills","_killsH","_killsB","_zombies","_zombiesA","_groups","_dead","_loot","_wrecks","_lootL","_freeTarget","_startcombattimer","_combattimeout","_timeleft","_color","_pmon1","_combatdisplay","_combatcontrol","_myPos","_lastPos","_debugAlex"];
  2. disableSerialization;
  3. _timeOut = 0;
  4. _messTimer = 0;
  5. _lastSave = 0;
  6. _lastTemp = dayz_temperatur;
  7. _debug = getMarkerpos "respawn_west";
  8. _isBandit = false;
  9. _isHero = false;
  10. player setVariable ["temperature",dayz_temperatur,true];
  11. _dayz_zombiesLocal = 0;
  12. _counzKill = 0;
  13.  
  14. dayz_myLoad = (((count dayz_myBackpackMags) * 0.2) + (count dayz_myBackpackWpns)) + (((count dayz_myMagazines) * 0.1) + (count dayz_myWeapons * 0.5));
  15.  
  16. while {true} do {
  17. //Initialize
  18. _refObj = vehicle player;
  19. _size = (sizeOf typeOf _refObj) * 0.6;
  20. _vel = velocity player;
  21. _speed = round((_vel distance [0,0,0]) * 3.5);
  22. _saveTime = (playersNumber west * 2) + 10;
  23.  
  24. //reset position
  25. _randomSpot = true;
  26. _tempPos = getPosATL player;
  27. _distance = _debug distance _tempPos;
  28. if (_distance < 150) then {
  29. _randomSpot = false;
  30. };
  31.  
  32. _distance = [0,0,0] distance _tempPos;
  33. if (_distance < 100) then {
  34. _randomSpot = false;
  35. };
  36. _distance = _mylastPos distance _tempPos;
  37. if (_distance > 400) then {
  38. _randomSpot = false;
  39. };
  40.  
  41. if (_randomSpot) then {
  42. _mylastPos = _tempPos;
  43. };
  44.  
  45. dayz_mylastPos = _mylastPos;
  46. dayz_areaAffect = _size;
  47.  
  48. //CheckVehicle
  49. /*
  50. if (_refObj != player) then {
  51. _isSync =_refObj getVariable ["ObjectID",0] > 0;
  52. if (!_isSync) then {
  53. _veh allowDamage true;
  54. _veh setDamage 1;
  55. player setDamage 1;
  56. };
  57. };
  58. */
  59.  
  60. if (_speed > 0.1) then {
  61. _timeOut = _timeOut + 1;
  62. };
  63.  
  64. _humanity = player getVariable ["humanity",0];
  65. //diag_log format ["player_spawn_2 humanity =%1",_humanity];
  66. //if (_timeOut > 150) then {
  67. // _timeOut = 0;
  68. // if (_humanity < 2500) then {
  69. // _humanity = _humanity + 150;
  70. // _humanity = _humanity min 2500;
  71. // };
  72. //}; //STOP+
  73.  
  74. //LEVELING AlexSpain alex.spain.2009
  75. if (_humanity < -15000 and _timeOut > 5) then {
  76. //_isBandit3 = true;
  77. _model = typeOf player;
  78. if (_model in ["Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit1_DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ"]) then {
  79.  
  80. _toModel = "Bandit3_1";
  81. _timeOut = 0;
  82. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  83. };
  84. if (_model in ["ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"]) then {
  85. _toModel = ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6"] select floor random 6;
  86. _timeOut = 0;
  87. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  88. };
  89. };
  90.  
  91. if (_humanity >= -15000 and _humanity <= -6500 and _timeOut > 5) then {
  92. _isBandit2 = true;
  93. _model = typeOf player;
  94. if (_model in ["Bandit3_1","Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit1_DZ"]) then {
  95.  
  96. _toModel = ["Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ"] select floor random 5;
  97. _timeOut = 0;
  98. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  99. };
  100. if (_model in ["ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"]) then {
  101. _toModel = ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6"] select floor random 6;
  102. _timeOut = 0;
  103. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  104. };
  105. };
  106.  
  107. if (_humanity > -6500 and _humanity <= 2000 and _timeOut > 5) then {
  108. _isBandit = true;
  109. _model = typeOf player;
  110. if (_model in ["Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"]) then {
  111.  
  112. _toModel = ["Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit1_DZ"] select floor random 6;
  113. _timeOut = 0;
  114. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  115. };
  116. if (_model in ["ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"]) then {
  117. _toModel = ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6"] select floor random 6;
  118. _timeOut = 0;
  119. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  120. };
  121. };
  122.  
  123. if (_humanity > 2000 and _humanity < 2900 and _timeOut > 5) then {
  124. //_isBandit = false;
  125. _model = typeOf player;
  126. if (_model in ["Bandit1_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Bandit_S_DZ","Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ"]) then {
  127. if (_model=="Bandit_S_DZ") then {
  128. _toModel = "Sniper1_DZ";
  129. } else {
  130. _toModel = ["Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"] select floor random 12;
  131. };
  132. _timeOut = 0;
  133. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  134. };
  135. if (_model in ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"]) then {
  136. _toModel = ["ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ"] select floor random 7;
  137. _timeOut = 0;
  138. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  139. };
  140. };
  141.  
  142. if (_humanity >= 2900 and _humanity < 6500 and _timeOut > 5) then {
  143. //_isBandit = false;
  144. _model = typeOf player;
  145. if (_model in ["Bandit1_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ"]) then {
  146. _toModel = ["Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ"] select floor random 8;
  147. _timeOut = 0;
  148. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  149. };
  150. if (_model in ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ"]) then {
  151. _toModel = ["ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"] select floor random 6;
  152. _timeOut = 0;
  153. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  154. };
  155. };
  156.  
  157. if (_humanity >= 6500 and _humanity <= 15000 and _timeOut > 5) then {
  158. //_isBandit = false;
  159. _model = typeOf player;
  160. if (_model in ["Bandit1_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ"]) then {
  161. _toModel = ["Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ"] select floor random 6;
  162. _timeOut = 0;
  163. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  164. };
  165. if (_model in ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ"]) then {
  166. _toModel = ["ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"] select floor random 6;
  167. _timeOut = 0;
  168. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  169. };
  170. };
  171. if (_humanity > 15000 and _timeOut > 5) then {
  172. //_isBandit = false;
  173. _model = typeOf player;
  174. if (_model in ["Bandit1_DZ","Bandit1_1DZ","Bandit1_2DZ","Bandit1_3DZ","Bandit1_3_1DZ","Bandit1_3_2DZ","Bandit2_1DZ","Bandit2_2DZ","Bandit2_3DZ","Bandit2_4DZ","Bandit2_5DZ","Bandit3_1","Hero2_1DZ","Hero2_2DZ","Hero2_3DZ","Hero2_4DZ","Hero2_5DZ","Hero2_10DZ","Survivor2_DZ","Survivor2_1DZ","Survivor2_2DZ","Survivor2_3DZ","Survivor4_DZ","Survivor4_1DZ","Survivor4_2DZ","Survivor4_3DZ","Survivor8_DZ","Survivor8_1DZ","Survivor8_2DZ","Survivor8_3DZ","Survivor3_DZ","Hero1_1DZ","Hero1_2DZ","Hero1_3DZ","Hero1_4DZ","Hero1_5DZ","Hero1_6DZ","Hero1_7DZ"]) then {
  175. _toModel = ["Hero3_1DZ","Hero3_2DZ","Hero3_3DZ","Hero3_4DZ","Hero3_5DZ","Hero3_6DZ"] select floor random 6;
  176. _timeOut = 0;
  177. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  178. };
  179. if (_model in ["ori_vil_woman_bandit_1","ori_vil_woman_bandit_2","ori_vil_woman_bandit_3","ori_vil_woman_bandit_4","ori_vil_woman_bandit_5","ori_vil_woman_bandit_6","ori_vil_woman_survivor_1","ori_vil_woman_survivor_2","ori_vil_woman_survivor_3","ori_vil_woman_survivor_4","ori_vil_woman_survivor_5","ori_vil_woman_survivor_6","SurvivorW2_DZ"]) then {
  180. _toModel = ["ori_vil_woman_hero_1","ori_vil_woman_hero_2","ori_vil_woman_hero_3","ori_vil_woman_hero_4","ori_vil_woman_hero_5","ori_vil_woman_hero_6"] select floor random 6;
  181. _timeOut = 0;
  182. [dayz_playerUID,dayz_characterID,_toModel] spawn player_humanityMorph;
  183. };
  184. };
  185.  
  186.  
  187. //Has infection?
  188. if (r_player_infected) then {
  189. [player,"cough",8,false] call dayz_zombieSpeak;
  190. };
  191.  
  192. //Record Check
  193. _lastUpdate = time - dayZ_lastPlayerUpdate;
  194. if (_lastUpdate > 8) then {
  195. //POSITION?
  196. _distance = dayz_myPosition distance player;
  197. if (_distance > 10) then {
  198. //Player has moved
  199. dayz_myPosition = getPosATL player;
  200. player setVariable["posForceUpdate",true,true];
  201. dayz_unsaved = true;
  202. dayZ_lastPlayerUpdate = time;
  203. };
  204. };
  205.  
  206. //Hunger
  207. _hunger = +((((r_player_bloodTotal - r_player_blood) / r_player_bloodTotal) * 5) + _speed + dayz_myLoad) * 3;
  208. if (time - dayz_panicCooldown < 120) then {
  209. _hunger = _hunger * 2;
  210. };
  211. dayz_hunger = dayz_hunger + (_hunger / 60);
  212.  
  213. //Thirst
  214. _thirst = 2;
  215. if (_refObj == player) then {
  216. _thirst = (_speed + 4) * 3;
  217. };
  218. dayz_thirst = dayz_thirst + (_thirst / 60) * (dayz_temperatur / dayz_temperaturnormal); //TeeChange Temperatur effects added Max Effects: -25% and + 16.6% waterloss
  219.  
  220. //Temperatur
  221. 2 call player_temp_calculation; //2 = sleep time of this loop //TeeChange
  222. if ((_lastTemp - dayz_temperatur) > 0.75 or (_lastTemp - dayz_temperatur) < -0.75 ) then {
  223. player setVariable ["temperature",dayz_temperatur,true];
  224. _lastTemp = dayz_temperatur;
  225. };
  226.  
  227. //can get nearby infection
  228. if (!r_player_infected) then {
  229. // Infectionriskstart
  230. if (dayz_temperatur < ((80 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange
  231. _listTalk = _mylastPos nearEntities ["CAManBase",8];
  232. {
  233. if (_x getVariable["USEC_infected",false]) then {
  234. _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 50); //TeeChange
  235. if (_rnd < 0.1) then {
  236. _rnd = random 1;
  237. if (_rnd > 0.7) then {
  238. r_player_infected = true;
  239. player setVariable["USEC_infected",true];
  240. };
  241. };
  242. };
  243. } forEach _listTalk;
  244. if (dayz_temperatur < ((50 / 100) * (dayz_temperaturnormal - dayz_temperaturmin) + dayz_temperaturmin)) then { //TeeChange
  245. _rnd = (random 1) * (((dayz_temperaturnormal - dayz_temperatur) * (100 /(dayz_temperaturnormal - dayz_temperaturmin)))/ 25); //TeeChange
  246. if (_rnd < 0.05) then {
  247. _rnd = random 1;
  248. if (_rnd > 0.95) then {
  249. r_player_infected = true;
  250. player setVariable["USEC_infected",true];
  251. };
  252. };
  253. };
  254. };
  255. };
  256.  
  257. //If has infection reduce blood
  258. if (r_player_infected) then {
  259. if (r_player_blood > 6000) then {
  260. r_player_blood = r_player_blood - 3;
  261. };
  262. };
  263.  
  264. //Hunger Effect
  265. _foodVal = dayz_statusArray select 0;
  266. _thirstVal = dayz_statusArray select 1;
  267. if (_thirstVal <= 0) then {
  268. _result = r_player_blood - 10;
  269. if (_result < 0) then {
  270. _id = [player,"dehyd"] spawn player_death;
  271. } else {
  272. r_player_blood = _result;
  273. };
  274. };
  275. if (_foodVal <= 0) then {
  276. _result = r_player_blood - 10;
  277. if (_result < 0) then {
  278. _id = [player,"starve"] spawn player_death;
  279. } else {
  280. r_player_blood = _result;
  281. };
  282. };
  283.  
  284. //Record low bloow
  285. _lowBlood = player getVariable ["USEC_lowBlood", false];
  286. if ((r_player_blood < r_player_bloodTotal) and !_lowBlood) then {
  287. player setVariable["USEC_lowBlood",true,true];
  288. };
  289.  
  290. //Broadcast Hunger/Thirst
  291. _messTimer = _messTimer + 1;
  292. if (_messTimer > 15) then {
  293. _messTimer = 0;
  294. player setVariable ["messing",[dayz_hunger,dayz_thirst],true];
  295. bb_base = player getVariable ["bb_base",[]];
  296. };
  297.  
  298. //check if can disconnect
  299. if (!dayz_canDisconnect) then {
  300. if ((time - dayz_damageCounter) > 180) then {
  301. if (!r_player_unconscious) then {
  302. dayz_canDisconnect = true;
  303. dayzDiscoRem = getPlayerUID player;
  304. publicVariableServer "dayzDiscoRem";
  305.  
  306. //Ensure Control is hidden
  307. _display = uiNamespace getVariable 'DAYZ_GUI_display';
  308. _control = _display displayCtrl 1204;
  309. _control ctrlShow false;
  310. };
  311. };
  312. };
  313. _counzKill = _hitter getVariable ["zCountKill",0];
  314. //Save Checker
  315. if (dayz_unsaved) then {
  316. if ((time - dayz_lastSave) > _saveTime) then {
  317. DOgNo_Se = [player,dayz_Magazines,false];
  318. publicVariableServer "DOgNo_Se";
  319. //diag_log format ["SAVE_Pspawn2=%1",DOgNo_Se];
  320. dayz_lastSave = time;
  321. dayz_Magazines = [];
  322. dayz_unsaved = false;
  323. };
  324. _lastSave = _lastSave + 2;
  325. } else {
  326. dayz_lastSave = time;
  327. _lastSave = 0;
  328. };
  329.  
  330. if (!dayz_unsaved) then {
  331. dayz_lastSave = time;
  332. };
  333.  
  334. //Attach Trigger Current Object
  335. //dayz_playerTrigger attachTo [_refObj,[0,0,0]];
  336. //dayz_playerTrigger setTriggerArea [_size,_size,0,false];
  337.  
  338. // If in combat, display counter and restrict logout
  339. _startcombattimer = player getVariable["startcombattimer",0];
  340. if (_startcombattimer == 1) then {
  341. player setVariable["combattimeout", time + 30, true];
  342. player setVariable["startcombattimer", 0, true];
  343. dayz_combat = 1;
  344. };
  345.  
  346. //Debug Info
  347. _headShots = player getVariable["headShots",0];
  348. _kills = player getVariable["zombieKills",0];
  349. _killsH = player getVariable["humanKills",0];
  350. _killsB = player getVariable["banditKills",0];
  351. _humanity = player getVariable["humanity",0];
  352. _zombies = count entities "zZombie_Base";
  353. _zombiesA = {alive _x} count entities "zZombie_Base";
  354.  
  355. hintSilent parseText format ["
  356. <t size='1.15' font='Bitstream' color='#5882FA'>Visit: www.youtube.com/josema0890</t><br/><br/>
  357. <t size='1.15' font='Bitstream' color='#5882FA'>Survived %7 Days</t><br/>
  358. <t size='0.95' font='Bitstream' align='left'>Players Online: </t><t size='0.95 'font='Bitstream' align='right'>%12</t><br/>
  359. <t size='0.95' font='Bitstream' align='left'>Murders: </t><t size='1.15' font='Bitstream' align='right'>%4</t><br/>
  360. <t size='0.95' font='Bitstream' align='left'>Bandits Killed: </t><t size='1.15' font='Bitstream' align='right'>%5</t><br/>
  361. <t size='0.95' font='Bitstream' align='left'>Zombies (alive/total): </t><t size='1.15' font='Bitstream' align='right'>%9/%8</t><br/>
  362. <t size='0.95' font='Bitstream' align='left'>Humanity: </t><t size='1.15' font='Bitstream' align='right'>%6</t><br/>
  363. <t size='0.95' font='Bitstream' align='left'>Blood: </t><t size='0.95' font='Bitstream' align='right'>%11</t><br/>
  364. <t size='1.25'font='Bitstream'align='center'color='#2ECCFA'>Fps: %10</t><br/>",
  365. (name player),
  366. (player getVariable['zombieKills', 0]),
  367. (player getVariable['headShots', 0]),
  368. (player getVariable['humanKills', 0]),
  369. (player getVariable['banditKills', 0]),
  370. (player getVariable['humanity', 0]),
  371. (dayz_skilllevel),
  372. (count entities "zZombie_Base"),
  373. ({alive _x} count entities "zZombie_Base"),
  374. (round diag_fps),
  375. r_player_blood,
  376. (count playableUnits)
  377. ];
  378.  
  379. /*
  380. setGroupIconsVisible [false,false];
  381. clearGroupIcons group player;
  382. */
  383. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, (r_player_blood/r_player_bloodTotal)], [1, 1, 1, 0.0]];
  384. "colorCorrections" ppEffectCommit 0;
  385. sleep 2;
  386.  
  387. _myPos = player getVariable["lastPos",[]];
  388. if (count _myPos > 0) then {
  389. player setVariable["lastPos",_mylastPos, true];
  390. player setVariable["lastPos",[]];
  391. };
  392.  
  393. _lastPos = getPosATL player;
  394. if (player == vehicle player) then {
  395. if (_mylastPos distance _lastPos > 200) then {
  396. if (alive player) then {
  397. player setPosATL _mylastPos;
  398. };
  399. };
  400. } else {
  401. if (_mylastPos distance _lastPos > 800) then {
  402. if (alive player) then {
  403. player setPosATL _mylastPos;
  404. };
  405. };
  406. };
  407. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement