Advertisement
Guest User

init_survival

a guest
Apr 7th, 2016
383
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 87.71 KB | None | 0 0
  1. [] spawn {
  2. while{true} do
  3. {
  4. uiSleep 45;
  5. [] call fnc_water;
  6. if (life_eattotal > 9) then {
  7. life_eattotal = life_eattotal - 1;
  8. };
  9.  
  10.  
  11. uiSleep 45;
  12. [] call fnc_food;
  13. if (life_eattotal > 9) then {
  14. life_eattotal = life_eattotal - 1;
  15. };
  16. };
  17. };
  18.  
  19. [] spawn {
  20. while{true} do
  21. {
  22. uisleep 300;
  23. [8] call SOCK_fnc_updatePartial;
  24. [] call fnc_overtime_stats;
  25. uisleep 300;
  26. [] call fnc_overtime_stats;
  27. };
  28. };
  29.  
  30. [] spawn
  31. {
  32. while {true} do
  33. {
  34. if(isNull objectParent player) then
  35. {
  36. if(life_seatwarn) then {
  37. life_seatwarn = false;
  38. };
  39. if(life_seatbelt) then {
  40. uiSleep 3;
  41. life_seatbelt = false;
  42. };
  43. uiSleep 5;
  44. };
  45. if(vehicle player != player && !(player getVariable ["Escorting", false]) && !(player getVariable ["restrained", false]) && (vehicle player isKindOf "LandVehicle")) then
  46. {
  47. if(speed vehicle player > 90 && !life_seatbelt) then
  48. {
  49. oldVehVelocity = velocity (vehicle player);
  50. uiSleep 0.3;
  51. if(speed vehicle player < 1) then
  52. {
  53. playSound "glassbreak";
  54. moveOut player;
  55. player setVelocity [(oldVehVelocity select 0) * 0.4,(oldVehVelocity select 1) * 0.4,((oldVehVelocity select 2) * 0.4) + 5];
  56. uiSleep 2;
  57. player switchmove "";
  58. };
  59. } else {
  60. if(!life_seatwarn) then {
  61. uiSleep 1;
  62. if(!life_seatwarn) then {
  63. ["Remember your Seatbelt!", false] spawn domsg;
  64. };
  65. playSound "seatwarn";
  66. life_seatwarn = true;
  67. };
  68. uiSleep 1;
  69. };
  70. };
  71. };
  72. };
  73.  
  74.  
  75. [] spawn
  76. {
  77. if(side player != civilian) exitWith {};
  78. while{true} do
  79. {
  80. _vehicle = vehicle player;
  81. if(vehicle player != player && driver (vehicle player) == player && ((_vehicle isKindOf "Car") || (_vehicle isKindOf "Motorcycle") || (_vehicle isKindOf "Bicycle") || (_vehicle isKindOf "Motorbike") || (_vehicle isKindOf "A3L_Tahoe_Base"))) then {
  82.  
  83. if((player distance (getMarkerPos "speed_cam_1")) < 20 || (player distance (getMarkerPos "speed_cam_2")) < 20 || (player distance (getMarkerPos "speed_cam_3")) < 20 || (player distance (getMarkerPos "speed_cam_4")) < 20 || (player distance (getMarkerPos "speed_cam_10")) < 20 ) then {
  84. _vel = speed player;
  85. if(_vel > 90 && _vel < 140) then {
  86. "colorCorrections" ppEffectEnable true;
  87. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  88. "colorCorrections" ppEffectCommit 0;
  89. uiSleep 0;
  90. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  91. "colorCorrections" ppEffectCommit 0.05;
  92. uiSleep 0.05;
  93. "colorCorrections" ppEffectEnable false;
  94. uiSleep 0.1;
  95. "colorCorrections" ppEffectEnable true;
  96. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  97. "colorCorrections" ppEffectCommit 0;
  98. uiSleep 0;
  99. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  100. "colorCorrections" ppEffectCommit 0.05;
  101. uiSleep 0.05;
  102. "colorCorrections" ppEffectEnable false;
  103.  
  104. ["You have been fined $100 for speeding in the city.", false] spawn domsg;
  105. if(cash_in_bank > 100) then {
  106. ["bank","take",100] call life_fnc_handleCash;
  107. };
  108. };
  109.  
  110. if(_vel > 139 && _vel < 200) then {
  111. "colorCorrections" ppEffectEnable true;
  112. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  113. "colorCorrections" ppEffectCommit 0;
  114. uiSleep 0;
  115. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  116. "colorCorrections" ppEffectCommit 0.05;
  117. uiSleep 0.05;
  118. "colorCorrections" ppEffectEnable false;
  119. uiSleep 0.1;
  120. "colorCorrections" ppEffectEnable true;
  121. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  122. "colorCorrections" ppEffectCommit 0;
  123. uiSleep 0;
  124. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  125. "colorCorrections" ppEffectCommit 0.05;
  126. uiSleep 0.05;
  127. "colorCorrections" ppEffectEnable false;
  128.  
  129. ["You have been fined $210 for excessive speed in the city.", false] spawn domsg;
  130. if(cash_in_bank > 210) then {
  131. ["bank","take",210] call life_fnc_handleCash;
  132. };
  133. };
  134. if(_vel > 199) then {
  135. ["You have been fined $2000, lost your license for very excessive speeds in a city.", false] spawn domsg;
  136. if(cash_in_bank > 2000) then {
  137. ["bank","take", 2000] call life_fnc_handleCash
  138. };
  139. player setVariable["defect_vehicle",true,true];
  140.  
  141. "colorCorrections" ppEffectEnable true;
  142. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  143. "colorCorrections" ppEffectCommit 0;
  144. uiSleep 0;
  145. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  146. "colorCorrections" ppEffectCommit 0.05;
  147. uiSleep 0.05;
  148. "colorCorrections" ppEffectEnable false;
  149. uiSleep 0.1;
  150. "colorCorrections" ppEffectEnable true;
  151. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  152. "colorCorrections" ppEffectCommit 0;
  153. uiSleep 0;
  154. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  155. "colorCorrections" ppEffectCommit 0.05;
  156. uiSleep 0.05;
  157. "colorCorrections" ppEffectEnable false;
  158.  
  159. if(license_civ_driver OR license_civ_truck OR license_civ_boat) then {
  160. license_civ_driver = false;
  161. license_civ_truck = false;
  162. license_civ_boat = false;
  163. [2] call SOCK_fnc_updatePartial;
  164. };
  165. };
  166. uiSleep 30;
  167. };
  168. if((player distance (getMarkerPos "speed_cam_5")) < 30 || (player distance (getMarkerPos "speed_cam_6")) < 30 || (player distance (getMarkerPos "speed_cam_7")) < 30 || (player distance (getMarkerPos "speed_cam_8")) < 30 || (player distance (getMarkerPos "speed_cam_9")) < 30 || (player distance (getMarkerPos "speed_cam_11")) < 30 || (player distance (getMarkerPos "speed_cam_12")) < 30 || (player distance (getMarkerPos "speed_cam_13")) < 30 || (player distance (getMarkerPos "speed_cam_14")) < 30 || (player distance (getMarkerPos "speed_cam_15")) < 30 || (player distance (getMarkerPos "speed_cam_16")) < 30 || (player distance (getMarkerPos "speed_cam_17")) < 30 || (player distance (getMarkerPos "speed_cam_18")) < 30) then {
  169. _vel = speed player;
  170. if(_vel > 140 && _vel < 160) then {
  171. ["You have been fined $100 for speeding.", false] spawn domsg;
  172. if(cash_in_bank > 100) then {
  173. ["bank","take",100] call life_fnc_handleCash;
  174. };
  175.  
  176. "colorCorrections" ppEffectEnable true;
  177. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  178. "colorCorrections" ppEffectCommit 0;
  179. uiSleep 0;
  180. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  181. "colorCorrections" ppEffectCommit 0.05;
  182. uiSleep 0.05;
  183. "colorCorrections" ppEffectEnable false;
  184. uiSleep 0.1;
  185. "colorCorrections" ppEffectEnable true;
  186. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  187. "colorCorrections" ppEffectCommit 0;
  188. uiSleep 0;
  189. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  190. "colorCorrections" ppEffectCommit 0.05;
  191. uiSleep 0.05;
  192. "colorCorrections" ppEffectEnable false;
  193.  
  194. };
  195. if(_vel > 159 && _vel < 224) then {
  196. ["You have been fined $350 for excessive speed.", false] spawn domsg;
  197. if(cash_in_bank > 350) then {
  198. ["bank","take",350] call life_fnc_handleCash;
  199. };
  200.  
  201. "colorCorrections" ppEffectEnable true;
  202. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  203. "colorCorrections" ppEffectCommit 0;
  204. uiSleep 0;
  205. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  206. "colorCorrections" ppEffectCommit 0.05;
  207. uiSleep 0.05;
  208. "colorCorrections" ppEffectEnable false;
  209. uiSleep 0.1;
  210. "colorCorrections" ppEffectEnable true;
  211. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  212. "colorCorrections" ppEffectCommit 0;
  213. uiSleep 0;
  214. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  215. "colorCorrections" ppEffectCommit 0.05;
  216. uiSleep 0.05;
  217. "colorCorrections" ppEffectEnable false;
  218.  
  219. };
  220. if(_vel > 225) then {
  221. ["You have been fined $1000, lost your license for very excessive speeds.", false] spawn domsg;
  222. if(cash_in_bank > 1000) then {
  223. ["bank","take", 1000] call life_fnc_handleCash
  224. };
  225. player setVariable["defect_vehicle",true,true];
  226.  
  227. "colorCorrections" ppEffectEnable true;
  228. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  229. "colorCorrections" ppEffectCommit 0;
  230. uiSleep 0;
  231. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  232. "colorCorrections" ppEffectCommit 0.05;
  233. uiSleep 0.05;
  234. "colorCorrections" ppEffectEnable false;
  235. uiSleep 0.1;
  236. "colorCorrections" ppEffectEnable true;
  237. "colorCorrections" ppEffectAdjust [1, 15, 0, [0.5, 0.5, 0.5, 0], [0.0, 0.5, 0.0, 0.6],[0.3, 0.3, 0.3, 0.05]];
  238. "colorCorrections" ppEffectCommit 0;
  239. uiSleep 0;
  240. "colorCorrections" ppEffectAdjust [1, 1, 0, [1, 1, 1, 0.0], [1, 1, 1, 0.6], [1, 1, 1, 0.6]];
  241. "colorCorrections" ppEffectCommit 0.05;
  242. uiSleep 0.05;
  243. "colorCorrections" ppEffectEnable false;
  244.  
  245. if(license_civ_driver OR license_civ_truck OR license_civ_boat) then {
  246. license_civ_driver = false;
  247. license_civ_truck = false;
  248. license_civ_boat = false;
  249. };
  250. };
  251. uiSleep 30;
  252. };
  253. uiSleep 0.5;
  254. } else {
  255. uiSleep 5;
  256. };
  257. };
  258. };
  259.  
  260. [] spawn
  261. {
  262. private["_bp","_load","_cfg"];
  263. while{true} do
  264. {
  265. waitUntil {backpack player != ""};
  266. _bp = backpack player;
  267. _cfg = getNumber(configFile >> "CfgVehicles" >> (backpack player) >> "maximumload");
  268. _load = round(_cfg / 8);
  269. life_maxWeight = life_maxWeightT + _load;
  270. waitUntil {uiSleep 1; (backpack player != _bp)};
  271. if(backpack player == "") then
  272. {
  273. life_maxWeight = life_maxWeightT;
  274. };
  275. };
  276. };
  277.  
  278. fnc_water =
  279. {
  280. if(life_thirst < 2) exitwith {
  281. ["Remove",0.25] call fnc_doHealth;
  282. playSound3D ["cg_sndimg\sounds\cough1.ogg", player, false, getPosASL player, 3, 1, 45];
  283. };
  284. if(life_thirst < 15) then {
  285. [7] spawn life_fnc_HudElements;
  286. playSound3D ["cg_sndimg\sounds\cough3.ogg", player, false, getPosASL player, 3, 1, 45];
  287. };
  288. if(!life_is_arrested) then {
  289. ["Remove","Drink",1] call fnc_sustain;
  290. };
  291. };
  292.  
  293.  
  294. fnc_food =
  295. {
  296. if(life_hunger < 2) exitwith {
  297. ["Remove",0.25] call fnc_doHealth;
  298. playSound3D ["cg_sndimg\sounds\cough4.ogg", player, false, getPosASL player, 3, 1, 45];
  299. };
  300. if(life_hunger < 15) then {
  301. playSound3D ["cg_sndimg\sounds\cough3.ogg", player, false, getPosASL player, 3, 1, 45];
  302. [7] spawn life_fnc_HudElements;
  303. };
  304. if(!life_is_arrested) then {
  305. ["Remove","Food",1] call fnc_sustain;
  306. };
  307. };
  308.  
  309.  
  310. fnc_battery =
  311. {
  312. _adjust = param [0,"",[""]];
  313. _amount = param [1,0,[0]];
  314. if(_adjust == "Reset") then { life_battery = 0; };
  315. if(_adjust == "Set") then { life_battery = _amount; };
  316. if(_adjust == "Add") then { life_battery = life_battery + _amount; };
  317. if(_adjust == "Remove") then { life_battery = life_battery - _amount; };
  318. };
  319.  
  320.  
  321.  
  322. fnc_battery_adjust =
  323. {
  324. if(life_battery < 2) exitwith {["Your phone battery is empty.", false] spawn domsg;};
  325.  
  326. _batloss = round (random 3);
  327. if(vehicle player == player) then {
  328. ["Remove",_batloss] call fnc_battery;
  329. } else {
  330. if(life_battery < 100) then {
  331. ["Add",_batloss] call fnc_battery;
  332. ["The vehicle has charged your phone.", false] spawn domsg;
  333. };
  334. };
  335.  
  336. if(life_battery < 10) then {
  337. ["Battery Low", false] spawn domsg; playSound3D ["cg_sndimg\sounds\phoneSMS.ogg", player, false, getPosASL player, 1, 1, 25];
  338. };
  339.  
  340. };
  341.  
  342.  
  343.  
  344. fnc_overtime_stats =
  345. {
  346. if(!life_is_arrested) then {
  347. _karma = round (random 5);
  348. ["Add",_karma] call fnc_karma;
  349. };
  350. _karma = round (random 5);
  351. life_poop = life_poop + _karma;
  352. call fnc_poop;
  353. };
  354.  
  355. fnc_poop =
  356. {
  357. if (life_poop > 80) then {
  358. _pooplord = getFatigue player;
  359. if (!deadPlayer && _pooplord < 1) then {
  360. player setFatigue _pooplord + 0.01;
  361. _chance = round (random 95);
  362. if(_chance == 19) then {
  363. [player,"fart1"] spawn life_fnc_nearestSound;
  364. };
  365. if(_chance == 20) then {
  366. [player,"fart2"] spawn life_fnc_nearestSound;
  367. };
  368. if(_chance == 21) then {
  369. [player,"fart3"] spawn life_fnc_nearestSound;
  370. };
  371. if(_chance == 22 || _chance == 23) then {
  372. [player,"fart4"] spawn life_fnc_nearestSound;
  373. };
  374. if(_chance == 24) then {
  375. [player,"fart5"] spawn life_fnc_nearestSound;
  376. };
  377. if(_chance == 25) then {
  378. [player,"fart6"] spawn life_fnc_nearestSound;
  379. };
  380. };
  381. };
  382. if (life_poop > 90) then {
  383. _pooplord = getFatigue player;
  384. if(!deadPlayer && _pooplord < 1) then {
  385. player setFatigue _pooplord + 0.01;
  386. };
  387. };
  388. };
  389.  
  390.  
  391. fnc_cruisecontrol = {
  392. start_speed = speed (vehicle player);
  393. cur_vehicle = vehicle player;
  394. koil_cruise = true;
  395. while {koil_cruise} do {
  396. if(!isEngineOn cur_vehicle) exitwith {};
  397. if (vehicle player == player) exitWith { };
  398. if (damage (vehicle player) > 0) exitWith { ["Vehicle is damaged.. Cruise Control is Disabled", false] spawn domsg; };
  399. if(!(isOnRoad player)) exitwith { ["Cruise Control Disabled on this type of Surface.", false] spawn domsg; };
  400. if(driver (vehicle player) != player) exitwith { };
  401.  
  402. _curspeed = speed (vehicle player);
  403. if (_curspeed < start_speed) then {
  404. _vel = velocity cur_vehicle;
  405. _dir = direction cur_vehicle;
  406. _speed = 0.0001;
  407. cur_vehicle setVelocity [
  408. (_vel select 0) + (sin _dir * _speed),
  409. (_vel select 1) + (cos _dir * _speed),
  410. (_vel select 2)
  411. ];
  412. };
  413. };
  414.  
  415. if(koil_cruise) then {
  416. koil_cruise = false;
  417. };
  418. };
  419.  
  420. fnc_doHealth =
  421. {
  422. if(deadPlayer) exitwith {};
  423. params [["_adjust", "", [""]], ["_amount", 0, [0]], ["_source", objNull, [objNull]]];
  424. if(_adjust == "Add") then {
  425. myHealth = myHealth - _amount;
  426. if(myHealth > 0.6 && (damage player) > 0) then {
  427. player setdamage 0;
  428. if(_amount > 0.1) then {
  429. [6] spawn life_fnc_HudElements;
  430. };
  431. };
  432. };
  433. if(_adjust == "Remove") then {
  434. myHealth = myHealth + _amount;
  435. if(myHealth > 0.75 && (damage player) < 0.8) then {
  436. player setdamage 0.85;
  437. };
  438. if(_amount > 0.1) then {
  439. [5] spawn life_fnc_HudElements;
  440. };
  441. };
  442.  
  443. if(_adjust == "Set") then {
  444. if((damage player) > 0) then {
  445. player setdamage 0;
  446. };
  447. [6] spawn life_fnc_HudElements;
  448. myHealth = _amount;
  449. };
  450.  
  451. if(myHealth < 0) then { myHealth = 0; };
  452. if(myHealth > 0.99) then {
  453. if(Myhealth > 1.8) then { myHealth = 1.8; };
  454. _damage = myHealth - 1;
  455. _damage = _damage * 10;
  456. [player,_source,_damage] spawn life_fnc_onPlayerKilled;
  457. };
  458. if(player getVariable "playerHealth" != myHealth) then {
  459. player setVariable["playerHealth", myHealth, true];
  460. };
  461. };
  462.  
  463. fnc_sustain =
  464. {
  465. _adjust = param [0,"",[""]];
  466. _type = param [1,"",[""]];
  467. _amount = param [2,0,[0]];
  468. if(_type == "Food") then {
  469. if(_adjust == "Add") then { life_hunger = life_hunger + _amount; };
  470. if(_adjust == "Remove") then { life_hunger = life_hunger - _amount; };
  471. if(life_hunger > 100) then {life_hunger = 100;};
  472. };
  473. if(_type == "Drink") then {
  474. if(_adjust == "Add") then { life_thirst = life_thirst + _amount; };
  475. if(_adjust == "Remove") then { life_thirst = life_thirst - _amount; };
  476. if(life_thirst > 100) then {life_thirst = 100;};
  477. };
  478. };
  479.  
  480.  
  481. fnc_karma =
  482. {
  483. _adjust = param [0,"",[""]];
  484. _amount = param [1,0,[0]];
  485. if(_adjust == "Add") then { life_karma = life_karma + _amount; [format["You just gained %1 reputation! Total: %2",_amount,life_karma], false] spawn domsg; };
  486. if(_adjust == "Remove") then { life_karma = life_karma - _amount; [format["You just lost %1 reputation! Total: %2",_amount,life_karma], false] spawn domsg; };
  487. _oldKarmaLevel = karma_level;
  488.  
  489. if(life_karma > 999) then {
  490. karma_level = life_karma / 400;
  491. karma_level = floor (karma_level);
  492. } else {
  493. karma_level = 0;
  494. };
  495.  
  496. if(life_karma < 0) then {
  497. life_rebelbadguyman = true;
  498. };
  499.  
  500. if(karma_level > 80) then {
  501. karma_level = 80;
  502. };
  503. if(_oldKarmaLevel < karma_level) then { ["You just leveled up!", false] spawn domsg; player say "levelup"; };
  504. if(_oldKarmaLevel > karma_level) then { ["You just lost a level!", false] spawn domsg; player say "endbeep"; };
  505. };
  506.  
  507. fnc_dirt =
  508. {
  509. if (life_dirt > 60) then {
  510. ["You feel dirty & probably smell.", false] spawn domsg;
  511. };
  512. if (life_dirt > 70) then {
  513. _koildebiiii = player getVariable ["diseaseon", 1];
  514. if(_koildebiiii == 1) then {
  515. _diseasechance = round (random 100);
  516.  
  517. if(_diseasechance > 99) then {
  518. player setVariable ["diseaseon",(round (random 7)),true];
  519. };
  520. };
  521. };
  522. if (life_dirt == 100) then {
  523. _pooplord = getFatigue player;
  524. player setFatigue _pooplord + 0.01;
  525. };
  526. };
  527.  
  528.  
  529. painIsActive = false;
  530. fnc_totalpain = {
  531. if(painIsActive) exitWith {};
  532. painIsActive = true;
  533. while{ koildeb > 1 || koildebi > 1 || koildebii > 1 || koildebiii > 1 || koildebiiii > 1 } do
  534. {
  535. _totalpain = koildeb + koildebi + koildebii + koildebiii + koildebiiii;
  536.  
  537. if(_totalpain < 12) then {
  538. "colorCorrections" ppEffectEnable true;
  539. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 0.5], [0, 0, 0, 0.0]];
  540. "colorCorrections" ppEffectCommit 3;
  541. uiSleep 2;
  542. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 1], [0, 0, 0, 0.0]];
  543. "colorCorrections" ppEffectCommit 3;
  544. uiSleep 2;
  545. };
  546.  
  547. if(_totalpain > 11 && _totalpain < 18) then {
  548. "colorCorrections" ppEffectEnable true;
  549. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 0.33], [0, 0, 0, 0.0]];
  550. "colorCorrections" ppEffectCommit 3;
  551. uiSleep 2;
  552. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 1], [0, 0, 0, 0.0]];
  553. "colorCorrections" ppEffectCommit 3;
  554. uiSleep 2;
  555. };
  556.  
  557. if(_totalpain > 17) then {
  558. "colorCorrections" ppEffectEnable true;
  559. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 0.1], [0, 0, 0, 0.0]];
  560. "colorCorrections" ppEffectCommit 3;
  561. uiSleep 2;
  562. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 1], [0, 0, 0, 0.0]];
  563. "colorCorrections" ppEffectCommit 3;
  564. uiSleep 2;
  565. };
  566. uiSleep 2;
  567. };
  568. painIsActive = false;
  569. };
  570.  
  571. fnc_damageChance = {
  572. if(damageChance) exitwith {};
  573. damageChance = true;
  574. _koildeb = player getVariable ["bleedingon", 1];
  575. if(_koildeb == 1) then {
  576. _chance = round (random 10000);
  577. if(_chance > 9996) then {
  578. player setVariable ["bleedingon",(round (random 5)),true];
  579. };
  580. };
  581.  
  582. _koildebi = player getVariable ["woundedon", 1];
  583. if(_koildebi == 1) then {
  584. _chance = round (random 10000);
  585. if(_chance > 9996) then {
  586. player setVariable ["woundedon",(round (random 5)),true];
  587. };
  588. };
  589.  
  590. _koildebii = player getVariable ["fractureon", 1];
  591. if(_koildebii == 1) then {
  592. _chance = round (random 10000);
  593. if(_chance > 9996) then {
  594. player setVariable ["fractureon",(round (random 7)),true];
  595. };
  596. };
  597.  
  598. _koildebiii = player getVariable ["unconciouson", 1];
  599. if(_koildebiii == 1) then {
  600. _chance = round (random 10000);
  601. if(_chance > 9996) then {
  602. player setVariable ["unconciouson",(round (random 7)),true];
  603. };
  604. };
  605.  
  606. _koildebiiii = player getVariable ["diseaseon", 1];
  607. if(_koildebiiii == 1) then {
  608. _diseasechance = round (random 100000);
  609. if(_diseasechance > 99998) then {
  610. player setVariable ["diseaseon",(round (random 7)),true];
  611. };
  612. };
  613. sleep 0.5;
  614. damageChance = false;
  615. };
  616.  
  617. fnc_quitjobs = {
  618. if(life_quitRecently) exitwith { ["You need to wait 5 minutes before using this again.", false] spawn domsg; };
  619. life_quitRecently = true;
  620. if(life_NewsJobs) exitwith { has_job = false; life_NewsJobs = false; };
  621. if(life_taxi) exitwith { has_job = false; fedex_on = false; };
  622. if(life_bankteller) exitwith { has_job = false; life_bankteller = false; };
  623. if(life_carSalesman) exitwith { has_job = false; life_carSalesman = false; };
  624. if(maintenance_on) exitwith { has_job = false; maintenance_on = false; };
  625. if(trucking) exitwith {
  626. has_job = false;
  627. trucking = false;
  628. deleteVehicle vehspawned;
  629. deleteVehicle vehspawned2;
  630. };
  631. if(fedex_on) exitwith {
  632. has_job = false; fedex_on = false;
  633. deleteVehicle vehspawned;
  634. };
  635. sleep 300;
  636. life_quitRecently = false;
  637. };
  638.  
  639. fnc_totalatm =
  640. {
  641. if(paid_recently) exitwith {
  642.  
  643. };
  644. myatmbonus = _this;
  645. paid_recently = true;
  646.  
  647. if (myatmbonus > 1000) then {
  648. myatmbonus = 1000;
  649. };
  650.  
  651. if (myatmbonus < 420) then {
  652. myatmbonus = 420;
  653. };
  654.  
  655. ["bank","add",round(myatmbonus)] call life_fnc_handleCash;
  656. [format["You just got paid $%1",myatmbonus], false] spawn domsg;
  657. uiSleep 180;
  658. paid_recently = false;
  659. };
  660.  
  661.  
  662.  
  663. fnc_del_houses = {
  664. _n = 0;
  665. if(count target_houses > 0) then {
  666.  
  667. {
  668. deleteMarkerLocal format["house_%1",_n];
  669. _n = _n + 1;
  670. } foreach target_houses;
  671. target_houses = 0;
  672. };
  673. };
  674.  
  675. fnc_totalmobile =
  676. {
  677. if(buy_off) exitwith {};
  678. buy_off = true;
  679. mybonus = _this;
  680. if (mybonus > 1000) then {
  681. mybonus = 1000;
  682. };
  683.  
  684. if (mybonus < 120) then {
  685. mybonus = 120;
  686. };
  687.  
  688. ["cash","add",round(mybonus)] call life_fnc_handleCash;
  689. [format["You just got paid $%1",mybonus], false] spawn domsg;
  690. uiSleep 180;
  691. buy_off = false;
  692. };
  693.  
  694. fnc_draw3d = {
  695. marker_on = false;
  696. sleep 0.3;
  697. marker_on = true;
  698. drawmessage = param [0,"",[""]];
  699. posinext = param [1,[],[[]]];
  700. while{marker_on} do {
  701. if(player distance posinext < 10 && drawmessage != "Driving Test") exitwith { ["You arrived to your location!",false] spawn domsg; };
  702. if(player distance posinext < 110 && drawmessage == "Oil") exitwith { };
  703. if(drawmessage == "Oil Maintenance" && !maintenance_on) exitwith { };
  704. sleep 0.05;
  705. };
  706. marker_on = false;
  707. };
  708.  
  709. fnc_fadephone = {
  710. [] spawn {
  711. _fuck = ((uiNamespace getVariable "tabletmenu") displayCtrl 7017);
  712. _fuck ctrlsetfade 1;
  713. _fuck ctrlcommit 1;
  714. sleep 1;
  715. _fuck ctrlshow false;
  716. };
  717. };
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728. fnc_kearth = {
  729. closedialog 0;
  730. if(!allow_sat) exitwith { player say "satdisable"; ["kEarth Imaging Currently OFFLINE!",false] spawn domsg; };
  731. allow_sat = false;
  732. ["kEarth Imaging Currently ONLINE!",false] spawn domsg;
  733. life_kEarthCamera = "CAMERA" camCreate (getPosATL player);
  734. showCinemaBorder FALSE;
  735. life_kEarthCamera cameraEffect ["Internal","Back"];
  736. life_kEarthCamera camSetTarget player;
  737. life_kEarthCamera camSetFOV .9;
  738. life_kEarthCamera camSetFocus [50,0];
  739. life_kEarthCamera camSetRelPos [0,545,545];
  740. life_kEarthCamera camCommit 0;
  741. player say "satmove";
  742. life_kEarthCamera camSetRelPos [0,1,445];
  743. life_kEarthCamera camCommit 4.5;
  744.  
  745. "colorCorrections" ppEffectEnable true;
  746. "filmGrain" ppEffectEnable true;
  747. "filmGrain" ppEffectAdjust [0.1, -1, 0.1, 0.05, 1, false];
  748. "filmGrain" ppEffectCommit 2;
  749. "colorCorrections" ppEffectAdjust [1, 0.75, 0, [0.3,0.4,1,-0.1], [1,1,1,1], [-0.5,0,-1,3]];
  750. "colorCorrections" ppEffectCommit 2;
  751. _total = 0;
  752. while{true} do {
  753. if(_total > 10 || life_battery < 0) exitwith {};
  754. sleep 1;
  755. ["Remove",3] call fnc_battery;
  756. _total = _total + 1;
  757. };
  758. sleep 2;
  759. ["kEarth Imaging Currently OFFLINE!",false] spawn domsg;
  760. player say "satdisable";
  761. life_kEarthCamera cameraEffect ["TERMINATE","BACK"];
  762. camDestroy life_kEarthCamera;
  763. "colorCorrections" ppEffectAdjust [1, 1, -0.003, [0.0, 0.0, 0.0, 0.0], [1, 1, 1, 1], [0, 0, 0, 0.0]];
  764. "colorCorrections" ppEffectCommit 3;
  765. "colorCorrections" ppEffectEnable false;
  766. "filmGrain" ppEffectAdjust [0, 0, 0, 0, 1, false];
  767. "filmGrain" ppEffectCommit 2;
  768. "filmGrain" ppEffectEnable false;
  769. sleep 600;
  770. ["kEarth Imaging is back ONLINE!",false] spawn domsg;
  771. allow_sat = true;
  772. };
  773.  
  774. fnc_dispatch = {
  775. if(dispatch) exitwith {};
  776. if(dispatch2) exitwith {};
  777. dispatch = true;
  778. _sound2play = param [0,"",[""]];
  779. playSound _sound2play;
  780. sleep 7;
  781. dispatch = false;
  782. };
  783.  
  784.  
  785.  
  786. fnc_phone_settings = {
  787. _todo = param [0,"",[""]];
  788.  
  789. if(_todo == "tags") then {
  790. if(phone_s_1) then {
  791. phone_s_1 = false;
  792. } else {
  793. phone_s_1 = true;
  794. };
  795. };
  796.  
  797. if(_todo == "HUD") then {
  798. if(phone_s_2) then {
  799. phone_s_2 = false;
  800. _one = _ui2 displayCtrl 1000;
  801. _one ctrlshow true;
  802. [] spawn life_fnc_hudSetup;
  803. } else {
  804. _ui = uiNameSpace getVariable ["playerHUD",displayNull];
  805. _idc = 2199;
  806. _idc2 = 23495;
  807. while{true} do {
  808. _todo1 = _ui displayctrl _idc;
  809. _todo2 = _ui displayCtrl _idc2;
  810. _todo1 ctrlshow false;
  811. _todo2 ctrlshow false;
  812. _idc = _idc + 1;
  813. _idc2 = _idc2 + 5;
  814. if(_idc == 2233) exitwith {};
  815. };
  816. _one = _ui2 displayCtrl 1000;
  817. _one ctrlshow false;
  818. _one = _ui displayCtrl 23915;
  819. _two = _ui displayCtrl 23905;
  820. _three = _ui displayCtrl 23910;
  821. _four = _ui displayCtrl 23920;
  822. _one ctrlshow false;
  823. _two ctrlshow false;
  824. _three ctrlshow false;
  825. _four ctrlshow false;
  826. phone_s_2 = true;
  827. };
  828. };
  829. };
  830.  
  831. fnc_delivery = {
  832. _mytype = _this;
  833. if(_mytype isEqualTo "standard") exitwith {
  834. _chance = round (random 7);
  835. if(_chance < 2) then {
  836. player addItemToBackpack "CG_Pro_Item_i";
  837. ["Someone just sent you a Go Pro! Check your backpack!", false] spawn domsg;
  838. ["Add",1] call fnc_karma;
  839. };
  840. if(_chance isEqualTo 2) then {
  841. ["cash","add",1250] call life_fnc_handleCash;
  842. ["You just got $7250!", false] spawn domsg;
  843. ["Add",3] call fnc_karma;
  844. };
  845. if(_chance isEqualTo 3) then {
  846. ["cash","add",500] call life_fnc_handleCash;
  847. ["You just got $500!", false] spawn domsg;
  848. ["Add",2] call fnc_karma;
  849. };
  850. if(_chance isEqualTo 6) then {
  851. player addItemToBackpack "CG_ATF_Drug_Bottle_01_i";
  852. player addItemToBackpack "CG_ATF_Drug_Bottle_01_i";
  853. ["Someone just sent you medicine, you feeling okay? Check your backpack!", false] spawn domsg;
  854. ["Add",5] call fnc_karma;
  855. };
  856. if(_chance isEqualTo 7) then {
  857. player addItemToBackpack "CG_ATF_Drug_Bottle_01_i";
  858. ["Someone just sent you medicine, you feeling okay? Check your backpack!", false] spawn domsg;
  859. ["Add",5] call fnc_karma;
  860. };
  861. if(_chance isEqualTo 4) then {
  862. ["cash","add",2500] call life_fnc_handleCash;
  863. ["You just got $2500!", false] spawn domsg;
  864. ["Add",15] call fnc_karma;
  865. };
  866. if(_chance isEqualTo 5) then {
  867. _lootArr = ["emerald","ruby","sapphire"];
  868. _loot = _lootArr select floor random count _lootArr;
  869. [true,_loot,3] call life_fnc_handleInv;
  870. ["Someone just sent you some valuable jewels, check your Virtual Inventory!", false] spawn domsg;
  871. ["Add",3] call fnc_karma;
  872. };
  873. };
  874.  
  875. if(_mytype isEqualTo "fastfood") exitwith {
  876. player addItemToBackpack "CG_ATF_Pizza_Box_i";
  877. ["Fastfood Delivery! Check your backpack!", false] spawn domsg;
  878. player addItemToBackpack "CG_ATF_Donut_Box_i";
  879. ["Add",1] call fnc_karma;
  880. };
  881.  
  882. if(_mytype isEqualTo "fixit") exitwith {
  883. //todo
  884. };
  885.  
  886. if(_mytype isEqualTo "jail") exitwith {
  887. _chance = round (random 100);
  888. if(_chance < 20) then {
  889. player addItem "CG_ATF_Pizza_Box_i";
  890. player assignItem "CG_ATF_Pizza_Box_i";
  891. player addItem "CG_ATF_Donut_Box_i";
  892. player assignItem "CG_ATF_Donut_Box_i";
  893. player addweapon "A3L_Glock17";
  894. player addmagazine "A3L_Glock17mag";
  895. player addmagazine "A3L_Glock17mag";
  896. player addmagazine "A3L_Glock17mag";
  897. player addmagazine "A3L_Glock17mag";
  898. ["Someone just smuggled items into jail for you!", false] spawn domsg;
  899. };
  900. };
  901. };
  902.  
  903. [] spawn
  904. {
  905. if(side player == civilian) then {
  906. while {true} do {
  907. uiSleep 2;
  908. _radios = player call TFAR_fnc_radiosList;
  909. if(count _radios < 2) then {
  910.  
  911. if(count _radios > 0) then {
  912. if(!([(call TFAR_fnc_activeSwRadio),"cg_tabletd"] call TFAR_fnc_isSameRadio)) then {
  913. [] call fnc_checkphone;
  914. [] call fnc_resetCall;
  915. hint "Your radio has been replaced with a phone!";
  916. };
  917. };
  918.  
  919. _wtflol = call TFAR_fnc_haveLRRadio;
  920. if(_wtflol) then {
  921. _channel = (call TFAR_fnc_ActiveLRRadio) call TFAR_fnc_getLRChannel;
  922. _channel = _channel + 1;
  923. if (driver (vehicle player) == player && (vehicle player) != player) then {
  924. _curfreqlr = [(call TFAR_fnc_activeLrRadio), _channel] call TFAR_fnc_GetChannelFrequency;
  925. _curfreqlr = parseNumber _curfreqlr;
  926. if( _curfreqlr > 33 && _curfreqlr < 34 ) then {
  927. ["33.1 - 33.9 are blocked frequencies.", false] spawn domsg;
  928. [(call TFAR_fnc_activeLrRadio), _channel, "40"] call TFAR_fnc_SetChannelFrequency;
  929. };
  930. };
  931. };
  932.  
  933. _wtfno = call TFAR_fnc_haveSWRadio;
  934. if(_Wtfno) then {
  935. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  936. _channel = _channel + 1;
  937. _curfreqsr = [(call TFAR_fnc_activeSwRadio), _channel] call TFAR_fnc_GetChannelFrequency;
  938. _curfreqsr = parseNumber _curfreqsr;
  939. if(!isNil "_curfreqsr") then {
  940. if( _curfreqsr > 33 && _curfreqsr < 34 ) then {
  941. ["33.1 - 33.9 are blocked frequencies.", false] spawn domsg;
  942. [(call TFAR_fnc_activeSwRadio), _channel, "40"] call TFAR_fnc_SetChannelFrequency;
  943. };
  944. };
  945. };
  946. }
  947. else
  948. {
  949. ["Your radios are interfering with each other, drop one to fix it.", false] spawn domsg;
  950. {
  951. if(_forEachIndex != 0) then
  952. {
  953. player unassignItem (_radios select (_forEachIndex - 1));
  954. player assignItem (_radios select (_forEachIndex));
  955. };
  956. _wtfno = call TFAR_fnc_haveSWRadio;
  957. if(_Wtfno) then {
  958. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  959. _channel = _channel + 1;
  960. _curfreqsr = [(call TFAR_fnc_activeSwRadio), _channel] call TFAR_fnc_GetChannelFrequency;
  961. if(!isNil "_curfreqsr") then {
  962. [(call TFAR_fnc_activeSwRadio), _channel, str (round(random 480)+30)] call TFAR_fnc_SetChannelFrequency;
  963. };
  964. };
  965. if((count _radios - 1) == _forEachIndex) then
  966. {
  967. player unassignItem (_radios select (_forEachIndex));
  968. player assignItem (_radios select 0);
  969. };
  970. } forEach _radios;
  971. uiSleep 3;
  972. };
  973. };
  974. };
  975. };
  976.  
  977.  
  978.  
  979. fnc_airkit =
  980. {
  981. if(!life_ApplyAir) then {
  982. life_ApplyAir = true;
  983. _buym = 1;
  984. while {_buym < 18} do {
  985. player setOxygenRemaining 1;
  986. uiSleep 10;
  987. _buym = _buym + 1;
  988. };
  989. life_ApplyAir = false;
  990. };
  991. };
  992.  
  993.  
  994. [] spawn
  995. {
  996. while {true} do
  997. {
  998. uiSleep 3;
  999. if(life_carryWeight > life_maxWeight && !isForcedWalk player) then {
  1000. player forceWalk true;
  1001. player setFatigue 1;
  1002. [localize "STR_NOTF_MaxWeight", false] spawn domsg;
  1003. } else {
  1004. if(isForcedWalk player && !(player getVariable["severeInjuries",FALSE])) then {
  1005. player forceWalk false;
  1006. };
  1007. };
  1008. };
  1009. };
  1010.  
  1011.  
  1012. [] spawn
  1013. {
  1014. while {true} do
  1015. {
  1016. if(side player == west) exitwith {};
  1017. uiSleep 5;
  1018. if(!(rebelshipment getVariable["progress",FALSE])) then { uisleep 10; };
  1019. if(player distance rebelshipment < 300 && (rebelshipment getVariable["progress",FALSE])) then { ["You have entered a red-zone, you can be shot if you have a weapon out.", false] spawn domsg; sleep 60;};
  1020. };
  1021. };
  1022.  
  1023. fnc_intox =
  1024. {
  1025. [] spawn {
  1026. uiSleep 110;
  1027. if(life_intox > 0) then
  1028. {
  1029. if(life_intox <= 0.02) then {life_intox = 0.00;} else {life_intox = life_intox - 0.02;};
  1030. switch(true) do {
  1031. case (life_intox == 0.00): {["You are completely sober.", false] spawn domsg;};
  1032. case (life_intox == 0.08): {["You can now legally drive.", false] spawn domsg;};
  1033. };
  1034. };
  1035. };
  1036. if(life_intox <= 0.08) exitWith {};
  1037. if(player getVariable["intoxicated",false]) exitWith {};
  1038. player setVariable["intoxicated",true,true];
  1039. while{life_intox > 0.08} do
  1040. {
  1041. "dynamicBlur" ppEffectEnable true;
  1042. "dynamicBlur" ppEffectAdjust [0.5];
  1043. "dynamicBlur" ppEffectCommit 1;
  1044. uiSleep 5;
  1045. if(life_intox > 0.15) then {
  1046. _chance = round (random 100);
  1047. if(_chance < 5) then {
  1048. [] spawn KK_fnc_forceRagdoll;
  1049. };
  1050. };
  1051. if(life_intox > 0.25) then {
  1052. _chance = round (random 100);
  1053. if(_chance < 7) then {
  1054. [] spawn KK_fnc_forceRagdoll;
  1055. };
  1056. };
  1057. if(life_intox > 0.35) then {
  1058. _chance = round (random 100);
  1059. if(_chance < 8) then {
  1060. [] spawn KK_fnc_forceRagdoll;
  1061. };
  1062. };
  1063. if(life_intox > 0.45) then {
  1064. _chance = round (random 100);
  1065. if(_chance < 11 && _chance > 4) then {
  1066. [] spawn KK_fnc_forceRagdoll;
  1067. };
  1068. };
  1069.  
  1070. };
  1071. "dynamicBlur" ppEffectEnable false;
  1072. player setVariable["intoxicated",false,true];
  1073. };
  1074.  
  1075. [] spawn
  1076. {
  1077. private["_walkDis","_myLastPos","_MaxWalk","_runHunger","_runDehydrate"];
  1078. _walkDis = 0;
  1079. _myLastPos = (getPos player select 0) + (getPos player select 1);
  1080. _MaxWalk = 1200;
  1081. while{true} do
  1082. {
  1083. uiSleep 1;
  1084. if(deadPlayer) then {_walkDis = 0;}
  1085. else
  1086. {
  1087. _CurPos = (getPos player select 0) + (getPos player select 1);
  1088. if((_CurPos != _myLastPos) && (isNull objectParent player)) then
  1089. {
  1090. _walkDis = _walkDis + 1;
  1091. if(_walkDis == _MaxWalk) then
  1092. {
  1093. _walkDis = 0;
  1094. ["Remove","Food",10] spawn fnc_sustain;
  1095. ["Remove","Drink",10] spawn fnc_sustain;
  1096. };
  1097. };
  1098. _myLastPos = (getPos player select 0) + (getPos player select 1);
  1099. };
  1100. };
  1101. };
  1102. [] spawn
  1103. {
  1104. while{true} do
  1105. {
  1106. waitUntil {vehicle player != player};
  1107. waitUntil {isNull objectParent player};
  1108.  
  1109. _time = if (!life_seatbelt) then {time + 0.8} else {time + 1.5};
  1110. [] spawn {
  1111. uiSleep 0.1;
  1112. if(handgunWeapon player isEqualTo "" && primaryWeapon player isEqualTo "") exitWith {};
  1113. [player,"AmovPercMstpSnonWnonDnon"] remoteExecCall ["life_fnc_animSync"];
  1114. player switchMove "AmovPercMstpSnonWnonDnon";
  1115. };
  1116. while {_time > time} do {
  1117. if (currentWeapon player != "") then {
  1118. player action ["SwitchWeapon", player, player, 100];
  1119. };
  1120. };
  1121. uiSleep 1;
  1122. };
  1123. };
  1124.  
  1125.  
  1126. fnc_testaids = {
  1127. uiSleep 0.05;
  1128. if(draggingm) then {
  1129. closedialog 0;
  1130. ["Dragging is disabled while in a vehicle Inventory. Use Right Click to move items!", false] spawn doquickmsg;
  1131. };
  1132. };
  1133.  
  1134. fnc_testdupe = {
  1135. draggingm = false;
  1136. waituntil {!(isnull (finddisplay 602)) || handle};
  1137. nodrag1 = (findDisplay 602) DisplayAddEventHandler ["MouseButtonDown", "if(_this select 1 == 0) then { draggingm = true; };"];
  1138. nodrag2 = (findDisplay 602) DisplayAddEventHandler ["MouseButtonUp", "if(_this select 1 == 0) then { draggingm = false; };"];
  1139. nodrag3 = (findDisplay 602) DisplayAddEventHandler ["MouseMoving", " hint format[""%1"",_this]; if(draggingm) then { [] spawn fnc_testaids; };"];
  1140. waituntil {(isnull (finddisplay 602)) || handle};
  1141. (findDisplay 602) displayRemoveEventHandler ["MouseButtonDown",nodrag1];
  1142. (findDisplay 602) displayRemoveEventHandler ["MouseButtonUp",nodrag2];
  1143. (findDisplay 602) displayRemoveEventHandler ["MouseMoving",nodrag3];
  1144. };
  1145.  
  1146. fnc_gut_animal = {
  1147. private["_obj"];
  1148. _obj = param [0,ObjNull,[ObjNull]];
  1149. if(isNull _obj) exitWith {};
  1150. if(alive _obj) exitWith {};
  1151.  
  1152. if(([true,"Raw Meat",1] call life_fnc_handleInv)) then
  1153. {
  1154. deleteVehicle _obj;
  1155. ["You picked up 1 Raw Meat!", false] spawn domsg;
  1156. };
  1157. };
  1158.  
  1159.  
  1160. fnc_doorkick = {
  1161.  
  1162. _doorkick = 45;
  1163. _failed = false;
  1164. while{_doorkick > 0} do {
  1165. uisleep 1;
  1166. _doorkick = _doorkick - 1;
  1167. _locked = locked (vehicle player);
  1168. if(_doorkick == 44 || _doorkick == 25 || _doorkick == 10) then {
  1169. [player,"glassbreak"] spawn life_fnc_nearestSound;
  1170. };
  1171.  
  1172. if(_locked != 2) exitwith { _failed = true; };
  1173. sleep 1;
  1174. hint format["You are kicking out the doors %1 time remaining.",_doorkick];
  1175. _vehspeed = speed (vehicle player);
  1176. if(_vehspeed > 0) exitwith { _failed = true; };
  1177. };
  1178. hint "";
  1179. if(!_failed) then { player action ["Eject", vehicle player]; (vehicle player) lock 0; };
  1180. };
  1181.  
  1182. //double click functions
  1183. fnc_removeitem = {
  1184. _remove = _this select 0;
  1185. player unassignItem _remove;
  1186. player removeitem _remove;
  1187. };
  1188. //GoPro Toggle
  1189. fnc_gopro = {
  1190. if(life_gopro) then {
  1191. life_gopro = false;
  1192. } else {
  1193. life_gopro = true;
  1194. };
  1195. [player,"endbeep"] spawn life_fnc_nearestSound;
  1196. };
  1197.  
  1198.  
  1199.  
  1200. fnc_joinPaintball = {
  1201.  
  1202. if(life_is_arrested || (player getVariable ["restrained", false]) || (player getVariable ["tied", false])) exitwith {};
  1203.  
  1204. if( life_koil_race2 == 1 || life_koil_race == 1 || joinmode == 0 ) exitWith { ["This is currently disabled.", false] spawn domsg; };
  1205.  
  1206. if(cash_in_hand < 50) exitWith {hint "You do not have enough cash to join the game, you need $50!.";};
  1207.  
  1208. if (joinmode isEqualTo 0) then {
  1209. _PUID = getPlayerUID player;
  1210. _spielerGeld = cash_in_hand;
  1211. hint "A request has been sent to the server, please wait a moment.";
  1212. [_PUID,_spielerGeld] remoteExec ["TON_fnc_paintball",2];
  1213. joinmode = 1;
  1214. } else {
  1215. hint "You are already in the lobby..!";
  1216. };
  1217.  
  1218. };
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.  
  1225. fnc_deletefire = {
  1226. thefire1 call fnc_deleteFire2;
  1227. _status = _this select 0;
  1228. if(_status == "cleaned") then {
  1229. fire_loc1 = [0,0,0.1];
  1230. };
  1231. };
  1232.  
  1233. //fire
  1234. fnc_deletefire2 = {
  1235. _unit = _this;
  1236. { if (typeOf _x == "#particlesource") then { _x setdamage 1; deleteVehicle _x; } } forEach (_unit nearObjects 10);
  1237. };
  1238.  
  1239. fnc_startfire = {
  1240. ["standard"] spawn fnc_deletefire;
  1241. sleep 1;
  1242. thefire1 = "test_EmptyObjectForFireBig" createVehicleLocal fire_loc1;
  1243. };
  1244.  
  1245. fnc_police_fire = {
  1246. ["NEWS: Lakeside PD is on fire!", false] spawn domsg;
  1247. fire_loc1 = [8731,7232,0.1];
  1248. [] spawn fnc_startfire;
  1249. };
  1250.  
  1251. fnc_bank_fire = {
  1252. ["NEWS: Lakeside Bank is on fire!", false] spawn domsg;
  1253. fire_loc1 = [8531,6621,0.1];
  1254. [] spawn fnc_startfire;
  1255. };
  1256.  
  1257. fnc_wheat_fire = {
  1258. ["NEWS: Lakeside Wheat Field is on fire!", false] spawn domsg;
  1259. fire_loc1 = [8712,6595,0.1];
  1260. [] spawn fnc_startfire;
  1261. };
  1262.  
  1263. fnc_tiki_fire = {
  1264. ["NEWS: Lakeside Tiki Bar is on fire!", false] spawn domsg;
  1265. fire_loc1 = [7121,5400,0.1];
  1266. [] spawn fnc_startfire;
  1267. };
  1268.  
  1269. fnc_donuts_fire = {
  1270. ["NEWS: Lakeside Donuts is on fire!", false] spawn domsg;
  1271. fire_loc1 = [8679,6747,0.1];
  1272. [] spawn fnc_startfire;
  1273. };
  1274.  
  1275. fnc_pizza_fire = {
  1276. ["NEWS: Lakeside Pizza is on fire!", false] spawn domsg;
  1277. fire_loc1 = [8583,6613,0.1];
  1278. [] spawn fnc_startfire;
  1279. };
  1280.  
  1281. fnc_morrison_fire = {
  1282. ["NEWS: Morrison General and Fishing is on fire!", false] spawn domsg;
  1283. fire_loc1 = [5221,2854,0.1];
  1284. [] spawn fnc_startfire;
  1285. };
  1286.  
  1287. fnc_prison_fire = {
  1288. ["NEWS: Lakeside Prison is on fire!", false] spawn domsg;
  1289. fire_loc1 = [9646,10041,0.1];
  1290. [] spawn fnc_startfire;
  1291. };
  1292.  
  1293. fnc_searched =
  1294. {
  1295. _handle = [player,false] spawn life_fnc_dropItems;
  1296. waitUntil {scriptDone _handle};
  1297. life_carryWeight = 0;
  1298. };
  1299.  
  1300. fnc_spikeStrip_cg = {
  1301. private["_nearVehicles","_spikeStrip","_Obj"];
  1302.  
  1303. _mydir = (getdir player);
  1304. _obj = [player, 3.4, _myDir ] call BIS_fnc_relPos;
  1305. if(_myDir > 30 && _myDir < 181) then {
  1306. _obj = [player, 4.4, _myDir ] call BIS_fnc_relPos;
  1307. };
  1308. if(_myDir > 240 && _myDir < 341) then {
  1309. _obj = [player, 2.2, _myDir ] call BIS_fnc_relPos;
  1310. };
  1311. _spikeStrip = createVehicle ["CG_Spikes_Extended", _obj,[], 0, "CAN_COLLIDE"];
  1312. _spot = getPos _spikeStrip;
  1313. _spikestrip setdir (_myDir - 180);
  1314. _spikeStrip setVectorUp surfaceNormal _spot;
  1315.  
  1316. waitUntil { uiSleep 0.05; _nearVehicles = nearestObjects[getPos _spikeStrip,["Car"],7]; ( count _nearVehicles > 0 || isNull _spikeStrip || player distance _spikestrip > 250 || deadPlayer ) };
  1317. deletevehicle _spikestrip;
  1318. if(count _nearVehicles > 0) then { _vehicle = _nearvehicles select 0; [_vehicle] remoteExecCall ["life_fnc_spikeStripEffect",_vehicle]; };
  1319. };
  1320.  
  1321.  
  1322. //Because fuck public variables and being tidy.
  1323. fnc_CurrentCallMenu = {
  1324. if(!callInProgress) exitwith { ["You are not in a call!", false] spawn domsg; };
  1325. closedialog 0;
  1326. private["_display","_list","_side"];
  1327. disableSerialization;
  1328. _myID = player getVariable "PhoneID";
  1329. createdialog "Life_CurrentPhoneCall_Menu";
  1330. waitUntil {!isNull (findDisplay 5337)};
  1331. _display = findDisplay 5337;
  1332. _list = _display displayCtrl 5338;
  1333. lbClear _list;
  1334. {
  1335. _userID = _x getvariable "PhoneID";
  1336. if( _userID == _myID && _x != player) then {
  1337. _side = switch(side _x) do {case west: {"Cop"}; case east : {"Mafia"}; case civilian : {"Civ"}; case independent : {"Medic"}; default {"Unknown"}; };
  1338. _list lbAdd format["%1 - %2", name _x,_side];
  1339. _list lbSetdata [(lbSize _list)-1,str(_x)];
  1340. };
  1341. } foreach playableUnits;
  1342. };
  1343.  
  1344.  
  1345. fnc_CallMenu = {
  1346. private["_display","_list","_side"];
  1347. disableSerialization;
  1348. createdialog "Life_PhoneCall_Menu";
  1349. waitUntil {!isNull (findDisplay 5337)};
  1350. _display = findDisplay 5337;
  1351. _list = _display displayCtrl 5338;
  1352. lbClear _list;
  1353. {
  1354. if(_x != player) then {
  1355. _side = switch(side _x) do {case west: {"Cop"}; case east : {"Mafia"}; case civilian : {"Civ"}; case independent : {"Medic"}; default {"Unknown"}; };
  1356. _list lbAdd format["%1 - %2", name _x,_side];
  1357. _list lbSetdata [(lbSize _list)-1,str(_x)];
  1358. };
  1359. } foreach playableUnits;
  1360.  
  1361. if(side player != civilian) then {
  1362. player setvariable["PhoneCallNumber",0,true];
  1363. player setvariable["PhoneID",0,true];
  1364. callInProgress = false;
  1365. myCallOwner = player;
  1366. _mynumber = getPlayerUID player;
  1367. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1368. _channel = _channel + 1;
  1369. [(call TFAR_fnc_activeSwRadio), _channel, _mynumber] call TFAR_fnc_SetChannelFrequency;
  1370. call TFAR_fnc_HideHint;
  1371. };
  1372.  
  1373.  
  1374. };
  1375.  
  1376. fnc_callSomebody = {
  1377. private["_unit"];
  1378. _unit = lbData[5338,lbCurSel (5338)];
  1379. _unit = call compile format["%1", _unit];
  1380. closeDialog 0;
  1381. if(isNil "_unit") exitwith {};
  1382. if(isNull _unit) exitWith {};
  1383. if(tryingcall) exitwith { ["Please wait before adding a person to the call - one is being connected!", false] spawn domsg; };
  1384. if(PhonesRinging) exitwith { ["Please wait before adding a person to the call - one is being connected!", false] spawn domsg; };
  1385. [] spawn fnc_checkCall;
  1386. myCallOwner remoteExec ["fnc_ringPlayer",_unit];
  1387. };
  1388.  
  1389. fnc_checkCall = {
  1390. tryingcall = true;
  1391. private["_total","_endme","_newTotal"];
  1392. _endme = 0;
  1393. _total = myCallOwner getVariable "PhonecallNumber";
  1394. _newTotal = _total + 1;
  1395. if(_total == 0) then {
  1396. while{tryingCall} do {
  1397. playSound "cgphone_call";
  1398. sleep 5;
  1399. _endme = _endme + 5;
  1400. _total = myCallOwner getVariable "PhonecallNumber";
  1401. if(_total == 1) exitwith { [] call fnc_answered; player call fnc_answercall; playSound "cgphone_static"; };
  1402. if(_endme > 20) exitwith { [] call fnc_noanswer; };
  1403. };
  1404. } else {
  1405. while{tryingCall} do {
  1406. playSound "cgphone_call";
  1407. sleep 5;
  1408. _endme = _endme + 5;
  1409. _total = myCallOwner getVariable "PhonecallNumber";
  1410. if(_total == _newTotal) exitwith { [] call fnc_answered; };
  1411. if(_endme > 20) exitwith { [] call fnc_noanswer; };
  1412. };
  1413. };
  1414. tryingcall = false;
  1415. };
  1416.  
  1417. fnc_answered = {
  1418. playSound "cgphone_click";
  1419. ["Person entered your call!", false] spawn domsg;
  1420. };
  1421.  
  1422. fnc_noanswer = {
  1423. playSound "cgphone_hangup";
  1424. ["They didnt answer your call!", false] spawn domsg;
  1425. };
  1426.  
  1427. fnc_busyAnswer = {
  1428. tryingcall = false;
  1429. playSound "cgphone_hangup";
  1430. ["This phone is in a call - try texting!", false] spawn domsg;
  1431. };
  1432.  
  1433.  
  1434. fnc_ringPlayer = {
  1435. CurrentCaller = _this;
  1436. _radios = player call TFAR_fnc_radiosList;
  1437. if(count _radios > 0) then {
  1438. if( phoneDisabled ) exitwith { currentCaller remoteExec ["fnc_busyAnswer",currentCaller]; [format["A call from %1 went to your message bank! (Phone Disabled)",name CurrentCaller], false] spawn domsg; };
  1439. if( callInProgress || PhonesRinging ) exitwith { currentCaller remoteExec ["fnc_busyAnswer",currentCaller]; [format["A call from %1 went to your message bank! (In a Call) ",name CurrentCaller], false] spawn domsg; };
  1440. if( life_battery < 5 ) exitwith { currentCaller remoteExec ["fnc_busyAnswer",currentCaller]; [format["A call from %1 went to your message bank! (Low Battery) ",name CurrentCaller], false] spawn domsg; };
  1441.  
  1442. PhonesRinging = true;
  1443. _endme = 0;
  1444. while{PhonesRinging} do {
  1445. playSound "cgphone_call";
  1446. [format["You are being called by %1!",name currentcaller], false] spawn domsg;
  1447. sleep 5;
  1448. _endme = _endme + 5;
  1449. if(_endme > 20) exitwith { ["You missed a call!", false] spawn domsg; };
  1450. };
  1451.  
  1452. PhonesRinging = false;
  1453. } else {
  1454. currentCaller remoteExec ["fnc_busyAnswer",currentCaller];
  1455. ["You missed a call!", false] spawn domsg;
  1456. };
  1457. };
  1458.  
  1459. fnc_answercall = {
  1460. PhonesRinging = false;
  1461. myCallOwner = _this;
  1462. myPhoneCall = getPlayerUID myCallOwner;
  1463. player setvariable["PhoneID",myPhoneCall,true];
  1464. player setVariable ["tf_unable_to_use_radio", false];
  1465. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1466. _channel = _channel + 1;
  1467. [(call TFAR_fnc_activeSwRadio), _channel, myPhoneCall] call TFAR_fnc_SetChannelFrequency;
  1468. call TFAR_fnc_HideHint;
  1469. _total = myCallOwner getVariable "PhonecallNumber";
  1470. _total = _total + 1;
  1471. myCallOwner setvariable["PhoneCallNumber",_total,true];
  1472. [] spawn fnc_callProgress;
  1473. };
  1474.  
  1475. fnc_callProgress = {
  1476. callInProgress = true;
  1477. [] spawn {
  1478. while{callInProgress} do {
  1479. _total = myCallOwner getVariable "PhonecallNumber";
  1480. playSound "cgphone_static";
  1481. _total = _total / 2;
  1482. ["cash","take",_total] call life_fnc_handleCash;
  1483. [format["You were just charged %1 dollars for this call!",_total], false] spawn domsg;
  1484. sleep 140;
  1485. };
  1486. };
  1487. [] spawn {
  1488. sleep 7;
  1489. while{callInProgress} do {
  1490. if( isNull myCallOwner ) exitwith { [] call fnc_resetcall; };
  1491. _total = myCallOwner getVariable "PhonecallNumber";
  1492. if( _total < 2 ) exitwith { [] call fnc_resetcall; };
  1493. if( deadPlayer && myCallOwner != player ) exitwith { ["Call Dropped (You were downed)", false] spawn domsg; [] call fnc_hangup };
  1494. if( life_battery < 5 ) exitwith { ["Call Dropped (Low Battery)", false] spawn domsg; [] call fnc_hangup };
  1495. sleep 5;
  1496. };
  1497. };
  1498. };
  1499.  
  1500. fnc_speakermode = {
  1501. _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwSpeakers;
  1502. if(_stereo) then {
  1503. ["Your phone is off speaker mode!", false] spawn doquickmsg;
  1504. } else {
  1505. ["Your phone is on speaker mode!", false] spawn doquickmsg;
  1506. };
  1507. [call TFAR_fnc_ActiveSWRadio] call TFAR_fnc_setSwSpeakers;
  1508. };
  1509.  
  1510. fnc_iVol = {
  1511. _volume = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwVolume;
  1512. _volume = _volume + 1;
  1513. if(_volume > 10) then { _volume = 10; };
  1514. [format["Volume: %1",_volume], false] spawn doquickmsg;
  1515. [(call TFAR_fnc_ActiveSWRadio), _volume] call TFAR_fnc_setSwVolume;
  1516. };
  1517.  
  1518. fnc_dVol = {
  1519. _volume = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwVolume;
  1520. _volume = _volume - 1;
  1521. if(_volume < 1) then { _volume = 1; };
  1522. [format["Volume: %1",_volume], false] spawn doquickmsg;
  1523. [(call TFAR_fnc_ActiveSWRadio), _volume] call TFAR_fnc_setSwVolume;
  1524. };
  1525.  
  1526. fnc_resetCall = {
  1527. if(side player == west) exitwith { [] call fnc_ChangePolice; };
  1528. if(side player == independent) exitwith { [] call fnc_ChangeEMS; };
  1529. playSound "cgphone_hangup";
  1530. player setvariable["PhoneCallNumber",0,true];
  1531. player setvariable["PhoneID",0,true];
  1532. callInProgress = false;
  1533. myCallOwner = player;
  1534. _mynumber = getPlayerUID player;
  1535. if(side player == civilian) then {
  1536. player setVariable ["tf_unable_to_use_radio", true];
  1537. };
  1538. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1539. _channel = _channel + 1;
  1540. [(call TFAR_fnc_activeSwRadio), _channel, _mynumber] call TFAR_fnc_SetChannelFrequency;
  1541. call TFAR_fnc_HideHint;
  1542. };
  1543.  
  1544. fnc_hangup = {
  1545. if(CallInProgress) then
  1546. {
  1547. playSound "cgphone_hangup";
  1548. if(player == myCallOwner) exitwith {
  1549. [] call fnc_resetcall;
  1550. callInProgress = false;
  1551. };
  1552. _total = myCallOwner getVariable "PhonecallNumber";
  1553. _total = _total - 1;
  1554. myCallOwner setvariable["PhoneCallNumber",_total,true];
  1555. [] call fnc_resetcall;
  1556. callInProgress = false;
  1557. };
  1558. };
  1559.  
  1560. fnc_phoneDisabled = {
  1561. if(PhoneDisabled) then {
  1562. PhoneDisabled = false;
  1563. ["Your calls are enabled!", false] spawn domsg;
  1564. } else {
  1565. PhoneDisabled = true;
  1566. ["Your calls are disabled!", false] spawn domsg;
  1567. };
  1568. };
  1569.  
  1570. fnc_trycall = {
  1571. if(callInProgress) exitwith {
  1572. ["You are adding someone to your current call!", false] spawn domsg;
  1573. [] call fnc_callMenu;
  1574. };
  1575. if(PhonesRinging) exitwith {
  1576. ["Connecting Current Call!", false] spawn domsg;
  1577. CurrentCaller spawn fnc_answerCall;
  1578. };
  1579. if(TryingCall) exitwith {
  1580. ["Please wait til your current call connection ends!", false] spawn domsg;
  1581. };
  1582.  
  1583. ["You are starting a new call!", false] spawn domsg;
  1584. [] call fnc_callMenu;
  1585.  
  1586. };
  1587.  
  1588.  
  1589. fnc_tryhangup = {
  1590. if(PhonesRinging) exitwith {
  1591. PhonesRinging = false;
  1592. ["Sent busy dial tone.", false] spawn domsg;
  1593. [] call fnc_hangup;
  1594. };
  1595.  
  1596. if(tryingCall) exitwith {
  1597. tryingcall = FALSE;
  1598. ["Stopping Current Connection.", false] spawn domsg;
  1599. [] call fnc_resetcall;
  1600. };
  1601.  
  1602. if(myCallOwner == player) exitwith {
  1603. ["Stopping Current Connection.", false] spawn domsg;
  1604. [] call fnc_resetcall;
  1605. };
  1606.  
  1607. if(callInProgress) exitwith {
  1608. ["Leaving Current Call.", false] spawn domsg;
  1609. [] call fnc_hangup;
  1610. };
  1611.  
  1612.  
  1613. ["Resetting call list.", false] spawn domsg;
  1614. [] call fnc_resetcall;
  1615.  
  1616. };
  1617.  
  1618. fnc_stereoRotation = {
  1619. _stereo = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getCurrentSwStereo;
  1620. _stereo = _stereo + 1;
  1621. if(_stereo > 2) then { _stereo = 0; };
  1622. [(call TFAR_fnc_ActiveSWRadio), _stereo] call TFAR_fnc_setSwStereo;
  1623. if(_stereo == 0) exitwith { ["Stereo Enabled.", false] spawn doquickmsg; };
  1624. if(_stereo == 1) exitwith { ["Left Ear Only Enabled.", false] spawn doquickmsg; };
  1625. if(_stereo == 2) exitwith { ["Right Ear Only Enabled.", false] spawn doquickmsg; };
  1626. };
  1627.  
  1628. fnc_ChangeEMS = {
  1629. if(side player == civilian || side player == east) exitwith {};
  1630. player setvariable["PhoneCallNumber",33.1,true];
  1631. player setvariable["PhoneID",33.1,true];
  1632. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1633. _channel = _channel + 1;
  1634. [(call TFAR_fnc_activeSwRadio), _channel, 33.1] call TFAR_fnc_SetChannelFrequency;
  1635. callInProgress = false;
  1636. myCallOwner = player;
  1637. player setVariable ["tf_unable_to_use_radio", false];
  1638. call TFAR_fnc_HideHint;
  1639. ["You are on the EMS Freq!", false] spawn domsg;
  1640. };
  1641. fnc_ChangeDOC = {
  1642. if(side player == civilian || side player == east) exitwith {};
  1643. player setvariable["PhoneCallNumber",33.2,true];
  1644. player setvariable["PhoneID",33.2,true];
  1645. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1646. _channel = _channel + 1;
  1647. [(call TFAR_fnc_activeSwRadio), _channel, 33.2] call TFAR_fnc_SetChannelFrequency;
  1648. callInProgress = false;
  1649. myCallOwner = player;
  1650. player setVariable ["tf_unable_to_use_radio", false];
  1651. call TFAR_fnc_HideHint;
  1652. ["You are on the DOC Freq!", false] spawn domsg;
  1653. };
  1654. fnc_ChangePolice = {
  1655. if(side player == civilian || side player == east) exitwith {};
  1656. player setvariable["PhoneCallNumber",33.3,true];
  1657. player setvariable["PhoneID",33.3,true];
  1658. _channel = (call TFAR_fnc_ActiveSwRadio) call TFAR_fnc_getSwChannel;
  1659. _channel = _channel + 1;
  1660. [(call TFAR_fnc_activeSwRadio), _channel, 33.3] call TFAR_fnc_SetChannelFrequency;
  1661. callInProgress = false;
  1662. myCallOwner = player;
  1663. player setVariable ["tf_unable_to_use_radio", false];
  1664. call TFAR_fnc_HideHint;
  1665. ["You are on the Police Freq!", false] spawn domsg;
  1666. };
  1667.  
  1668.  
  1669. fnc_dynamiteScript = {
  1670. private["_catch"];
  1671. player playmove "AmovPercMrunSnonWnonDf_AmovPercMstpSnonWnonDnon_gthEnd";
  1672. sleep 1;
  1673. _dirAdd = (-30) + random(60);
  1674. _speed = 20;
  1675. _Dir = (getdir player) + _dirAdd;
  1676. _vehicle = createVehicle ["vvv_anzuelo", [getpos player select 0, getpos player select 1, (getpos player select 2) + 3],[], 0, "CAN_COLLIDE"];
  1677. _vel = velocity _vehicle;
  1678. _vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2) + 12];
  1679. playSound3D ["CG_Jobs\sounds\exp\exp.ogg", player, false, getPosASL player, 11, 1, 35];
  1680.  
  1681.  
  1682. sleep 2.5;
  1683.  
  1684. if!(surfaceIsWater (getpos _vehicle)) exitwith {
  1685. hint "You lost your dynamite!";
  1686. deletevehicle _vehicle;
  1687. };
  1688.  
  1689. _catchPos = (getpos _vehicle);
  1690. hint "Successful Throw - Stand Back!";
  1691.  
  1692.  
  1693. sleep 8;
  1694. "R_60mm_HE" createvehicle [(getpos _vehicle select 0)-2,(getpos _vehicle select 1)+1,(getpos _vehicle select 2)-3];
  1695. "R_60mm_HE" createvehicle [(getpos _vehicle select 0),(getpos _vehicle select 1)+4,(getpos _vehicle select 2)-1];
  1696. "R_60mm_HE" createvehicle [(getpos _vehicle select 0)+3,(getpos _vehicle select 1),(getpos _vehicle select 2)-1];
  1697.  
  1698. deletevehicle _vehicle;
  1699.  
  1700.  
  1701. hint "Get close to pick up your catch!";
  1702.  
  1703. _timeout = 60;
  1704. while{true} do {
  1705. _timeout = _timeout - 1;
  1706. if(player distance _catchPos < 9) exitwith { _catch = true; };
  1707. if(_timeout < 1) exitwith { _catch = false; };
  1708. sleep 0.5;
  1709. };
  1710. if(_catch) then {
  1711. playSound3D ["vvv_fishingrod\sounds\splash.ogg", player, false, getPosASL player, 51, 1, 45];
  1712. hint "You picked up your catch!";
  1713. _amount = 1 + random(25);
  1714. while{_amount > 0} do {
  1715. _type = floor (random(5));
  1716. switch (_type) do
  1717. {
  1718. case 0 :
  1719. {
  1720. player additem "Fish_1_i";
  1721. };
  1722. case 1 :
  1723. {
  1724. player additem "Fish_1_i";
  1725. };
  1726. case 2 :
  1727. {
  1728. player additem "Fish_2_i";
  1729. };
  1730. case 3 :
  1731. {
  1732. player additem "Fish_3_i";
  1733. };
  1734. case 4 :
  1735. {
  1736. player additem "Fish_4_i";
  1737. };
  1738. case 5 :
  1739. {
  1740. player additem "Fish_5_i";
  1741. };
  1742.  
  1743. default
  1744. {
  1745. };
  1746. };
  1747. _amount = _amount - 1;
  1748. };
  1749. } else { hint "You didnt pick up your fish in time!";};
  1750. };
  1751.  
  1752. fnc_castScript = {
  1753. player playmove "AwopPercMstpSgthWrflDnon_start1";
  1754. sleep 1;
  1755. _dirAdd = (-30) + random(60);
  1756. _speed = 20;
  1757. _Dir = (getdir player) + _dirAdd;
  1758. _vehicle = createVehicle ["vvv_anzuelo", [getpos player select 0, getpos player select 1, (getpos player select 2) + 3],[], 0, "CAN_COLLIDE"];
  1759. _vel = velocity _vehicle;
  1760. _vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2) + 12];
  1761. playSound3D ["vvv_fishingrod\sounds\cast2.ogg", player, false, getPosASL player, 5, 1, 35];
  1762.  
  1763.  
  1764. sleep 2.5;
  1765.  
  1766. if!(surfaceIsWater (getpos _vehicle)) exitwith {
  1767. hint "You lost your bait!";
  1768. deletevehicle _vehicle;
  1769. };
  1770.  
  1771. hint "Successful Cast";
  1772. playSound3D ["vvv_fishingrod\sounds\splash.ogg", player, false, getPosASL _vehicle, 25, 1, 85];
  1773.  
  1774. _timeOut = 0;
  1775. _total = random(6);
  1776. _myStartSpot = getpos player;
  1777. _fail = false;
  1778.  
  1779. while{true} do {
  1780. sleep 3;
  1781. _timeOut = _timeOut + 3;
  1782. if(_timeOut > _total) exitwith {};
  1783. if(_myStartSpot distance player > 25) exitwith { _fail = true; };
  1784. };
  1785.  
  1786. if(_fail) exitwith {
  1787. hint "You lost your bait from moving too far.";
  1788. deletevehicle _vehicle;
  1789. };
  1790.  
  1791. _Dir = _Dir - 180;
  1792. _vel = velocity _vehicle;
  1793. _speed = 22;
  1794.  
  1795. _timeOut = 0;
  1796. playSound3D ["vvv_fishingrod\sounds\splash.ogg", player, false, getPosASL _vehicle, 25, 1, 85];
  1797. sleep 0.5;
  1798. playSound3D ["vvv_fishingrod\sounds\wind2.ogg", player, false, getPosASL player, 5, 1, 35];
  1799.  
  1800. player playmove "AmovPercMstpSrasWrflDnon_AmovPercMstpSrasWrflDnon_gear";
  1801.  
  1802. while{_timeOut < 12 && _vehicle distance player > 5} do {
  1803. _vehicle setpos [getpos _vehicle select 0, getpos _vehicle select 1, (getpos _vehicle select 2) + 0.2];
  1804. _vehicle setVelocity [(_vel select 0)+(sin _dir*_speed),(_vel select 1)+(cos _dir*_speed),(_vel select 2) + random(2)];
  1805. sleep 1;
  1806. _timeOut = _timeOut + 1;
  1807. player playaction "CRPTHSForwardStandLowered";
  1808. };
  1809.  
  1810. playSound3D ["vvv_fishingrod\sounds\splash.ogg", player, false, getPosASL player, 5, 1, 45];
  1811. player addmagazine "cebos";
  1812. deletevehicle _vehicle;
  1813.  
  1814. _type = floor (random(25));
  1815.  
  1816. switch (_type) do
  1817. {
  1818. case 0 :
  1819. {
  1820. player additem "Fish_1_i";
  1821. hint "You caught a Fish!";
  1822. };
  1823. case 1 :
  1824. {
  1825. player additem "Fish_1_i";
  1826. hint "You caught a Fish!";
  1827. };
  1828. case 2 :
  1829. {
  1830. player additem "Fish_2_i";
  1831. hint "You caught a Fish!";
  1832. };
  1833. case 3 :
  1834. {
  1835. player additem "Fish_3_i";
  1836. hint "You caught a Fish!";
  1837. };
  1838. case 4 :
  1839. {
  1840. player additem "Fish_4_i";
  1841. hint "You caught a Fish!";
  1842. };
  1843. case 5 :
  1844. {
  1845. player additem "Fish_5_i";
  1846. hint "You caught a Fish!";
  1847. };
  1848. case 6 :
  1849. {
  1850. player additem "Fish_1_i";
  1851. hint "You caught a Fish!";
  1852. };
  1853. case 7 :
  1854. {
  1855. player additem "Fish_2_i";
  1856. hint "You caught a Fish!";
  1857. };
  1858. case 8 :
  1859. {
  1860. player additem "Fish_3_i";
  1861. hint "You caught a Fish!";
  1862. };
  1863. case 9 :
  1864. {
  1865. player additem "Fish_4_i";
  1866. hint "You caught a Fish!";
  1867. };
  1868. case 10 :
  1869. {
  1870. player additem "Fish_5_i";
  1871. hint "You caught a Fish!";
  1872. };
  1873.  
  1874. default
  1875. {
  1876. hint "You failed to catch anything!";
  1877. };
  1878.  
  1879. };
  1880. };
  1881.  
  1882.  
  1883. fnc_cutWood = {
  1884. trees = [];
  1885. { if (str _x find ": t_" > -1) then { trees pushBack _x; }; } forEach nearestObjects [player, [], 9];
  1886.  
  1887. if(count trees > 0) then {
  1888. _sound = round(random 5);
  1889. switch(_sound) do {
  1890. case 0: {
  1891. playSound3D ["CG_Jobs\sounds\woodchop\woodchop1.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1892. };
  1893. case 1: {
  1894. playSound3D ["CG_Jobs\sounds\woodchop\woodchop2.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1895. };
  1896. case 2: {
  1897. playSound3D ["CG_Jobs\sounds\woodchop\woodchop3.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1898. };
  1899. case 3: {
  1900. playSound3D ["CG_Jobs\sounds\woodchop\woodchop4.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1901. };
  1902. case 4: {
  1903. playSound3D ["CG_Jobs\sounds\woodchop\woodchop5.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1904. };
  1905. default {
  1906. playSound3D ["CG_Jobs\sounds\woodchop\woodchop1.ogg", player, false, getPosasl (trees select 0), 31, 1, 15];
  1907. };
  1908. };
  1909.  
  1910. _treeCutChance = round(random 5);
  1911. if(_treeCutChance > 4) then {
  1912. [] spawn {
  1913. _sound = round(random 2);
  1914. switch(_sound) do {
  1915. case 0: {
  1916. playSound3D ["CG_Jobs\sounds\treefall\treefall1.ogg", player, false, getPosasl (trees select 0), 21, 1, 15];
  1917. };
  1918. case 1: {
  1919. playSound3D ["CG_Jobs\sounds\treefall\treefall2.ogg", player, false, getPosasl (trees select 0), 21, 1, 15];
  1920. };
  1921. default {
  1922. playSound3D ["CG_Jobs\sounds\treefall\treefall1.ogg", player, false, getPosasl (trees select 0), 21, 1, 15];
  1923. };
  1924. };
  1925. _tree = (trees select 0);
  1926. sleep 3;
  1927. _tree setdamage 1; sleep 2; [_tree,true] remoteExecCall ["hideobjectglobal",2];
  1928. [] call fnc_packLogs;
  1929. };
  1930. };
  1931. };
  1932. };
  1933.  
  1934. fnc_refineWood = {
  1935. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  1936. {
  1937. if(_x distance vehspawned < 11) then {
  1938. deletevehicle _x;
  1939. _sound = round(random 5);
  1940. playSound3D ["CG_Jobs\sounds\sawing\saw.ogg", player, false, getPosAsl Player, 11, 1, 15];
  1941. player additem "CG_Refined_Wood";
  1942. sleep 1.5;
  1943. hint "You are refining wood, stay still!"
  1944. };
  1945. } forEach attachedObjects vehspawned;
  1946. hint "Wood refined & placed in inventory";
  1947. totalLogs = 0;
  1948. };
  1949.  
  1950. fnc_packLogs = {
  1951. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  1952. if(totalLogs == 23) exitwith { hint "Load is full!"; };
  1953. mylog = createVehicle ["vvv_tronco", position player, [], 0, "NONE"];
  1954.  
  1955. totalLogs = totalLogs + 1;
  1956.  
  1957. if(totalLogs == 1) exitwith {
  1958. mylog attachTo [vehspawned, [-1, -3.5, 1.3] ]; mylog setdir 90;
  1959. };
  1960. if(totalLogs == 2) exitwith {
  1961. mylog attachTo [vehspawned, [-0.5, -3.5, 1.3] ]; mylog setdir 90;
  1962. };
  1963. if(totalLogs == 3) exitwith {
  1964. mylog attachTo [vehspawned, [0, -3.5, 1.3] ]; mylog setdir 90;
  1965. };
  1966. if(totalLogs == 4) exitwith {
  1967. mylog attachTo [vehspawned, [0.5, -3.5, 1.3] ]; mylog setdir 90;
  1968. };
  1969. if(totalLogs == 5) exitwith {
  1970. mylog attachTo [vehspawned, [1, -3.5, 1.3] ];mylog setdir 90;
  1971. };
  1972. if(totalLogs == 6) exitwith {
  1973. mylog attachTo [vehspawned, [-0.8, -3.5, 1.6] ]; mylog setdir 90;
  1974. };
  1975. if(totalLogs == 7) exitwith {
  1976. mylog attachTo [vehspawned, [-0.3, -3.5, 1.6] ]; mylog setdir 90;
  1977. };
  1978. if(totalLogs == 8) exitwith {
  1979. mylog attachTo [vehspawned, [0.3, -3.5, 1.6] ]; mylog setdir 90;
  1980. };
  1981. if(totalLogs == 9) exitwith {
  1982. mylog attachTo [vehspawned, [0.8, -3.5, 1.6] ]; mylog setdir 90;
  1983. };
  1984. if(totalLogs == 10) exitwith {
  1985. mylog attachTo [vehspawned, [-1, -3.5, 1.9] ]; mylog setdir 90;
  1986. };
  1987. if(totalLogs == 11) exitwith {
  1988. mylog attachTo [vehspawned, [-0.5, -3.5, 1.9] ]; mylog setdir 90;
  1989. };
  1990. if(totalLogs == 12) exitwith {
  1991. mylog attachTo [vehspawned, [0, -3.5, 1.9] ]; mylog setdir 90;
  1992. };
  1993. if(totalLogs == 13) exitwith {
  1994. mylog attachTo [vehspawned, [0.5, -3.5, 1.9] ]; mylog setdir 90;
  1995. };
  1996. if(totalLogs == 14) exitwith {
  1997. mylog attachTo [vehspawned, [1, -3.5, 1.9] ]; mylog setdir 90;
  1998. };
  1999. if(totalLogs == 15) exitwith {
  2000. mylog attachTo [vehspawned, [-0.8, -3.5, 2.2] ]; mylog setdir 90;
  2001. };
  2002. if(totalLogs == 16) exitwith {
  2003. mylog attachTo [vehspawned, [-0.3, -3.5, 2.2] ]; mylog setdir 90;
  2004. };
  2005. if(totalLogs == 17) exitwith {
  2006. mylog attachTo [vehspawned, [0.3, -3.5, 2.2] ]; mylog setdir 90;
  2007. };
  2008. if(totalLogs == 18) exitwith {
  2009. mylog attachTo [vehspawned, [0.8, -3.5, 2.2] ]; mylog setdir 90;
  2010. };
  2011. if(totalLogs == 19) exitwith {
  2012. mylog attachTo [vehspawned, [-1, -3.5, 2.5] ]; mylog setdir 90;
  2013. };
  2014. if(totalLogs == 20) exitwith {
  2015. mylog attachTo [vehspawned, [-0.5, -3.5, 2.5] ]; mylog setdir 90;
  2016. };
  2017. if(totalLogs == 21) exitwith {
  2018. mylog attachTo [vehspawned, [0, -3.5, 2.5] ]; mylog setdir 90;
  2019. };
  2020. if(totalLogs == 22) exitwith {
  2021. mylog attachTo [vehspawned, [0.5, -3.5, 2.5] ];mylog setdir 90;
  2022. };
  2023. if(totalLogs == 23) exitwith {
  2024. mylog attachTo [vehspawned, [1, -3.5, 2.5] ]; mylog setdir 90;
  2025. };
  2026. };
  2027.  
  2028.  
  2029. fnc_mineMetal = {
  2030.  
  2031. metals = nearestObjects [player, ["a3l_Bits_Rock_L_Iron","a3l_Bits_Rock_L_Coal","a3l_Bits_Rock_L_Diamond"], 5];
  2032.  
  2033. if(count metals > 0) then {
  2034.  
  2035. _vehicle = metals select 0;
  2036. _sound = round(random 5);
  2037.  
  2038. switch(_sound) do {
  2039. case 0: {
  2040. playSound3D ["CG_Jobs\sounds\mining\mine1.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2041. };
  2042. case 1: {
  2043. playSound3D ["CG_Jobs\sounds\mining\mine2.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2044. };
  2045. case 2: {
  2046. playSound3D ["CG_Jobs\sounds\mining\mine5.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2047. };
  2048. case 3: {
  2049. playSound3D ["CG_Jobs\sounds\mining\mine2.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2050. };
  2051. case 4: {
  2052. playSound3D ["CG_Jobs\sounds\mining\mine5.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2053. };
  2054. default {
  2055. playSound3D ["CG_Jobs\sounds\mining\mine1.ogg", player, false, getPosasl (metals select 0), 31, 1, 15];
  2056. };
  2057. };
  2058.  
  2059. _cutChance = round(random 130);
  2060. if(typeOf _vehicle isEqualTo "a3l_Bits_Rock_L_Coal" && _cutChance > 120) then {
  2061. playSound3D ["CG_Jobs\sounds\mining\mineF2.ogg", player, false, getPosasl (metals select 0), 25, 1, 15];
  2062. mybarrow = createVehicle ["land_wheelcart_f", [0,0,0], [], 0, "NONE"];
  2063. mybarrow attachto [player, [0, 1.3, 0.5] ];
  2064. myIron = createVehicle ["a3l_Bits_Rock_L_Coal", getpos player, [], 0, "NONE"];
  2065. myIron attachTo [myBarrow, [0, 0.8, 0.85] ];
  2066. };
  2067. if(typeOf _vehicle isEqualTo "a3l_Bits_Rock_L_Iron" && _cutChance > 80) then {
  2068. playSound3D ["CG_Jobs\sounds\mining\mineF2.ogg", player, false, getPosasl (metals select 0), 25, 1, 15];
  2069. mybarrow = createVehicle ["land_wheelcart_f", [0,0,0], [], 0, "NONE"];
  2070. mybarrow attachto [player, [0, 1.3, 0.5] ];
  2071. myIron = createVehicle ["a3l_Bits_Rock_L_Iron", getpos player, [], 0, "NONE"];
  2072. myIron attachTo [myBarrow, [0, 0.8, 0.85] ];
  2073. };
  2074. if(typeOf _vehicle isEqualTo "a3l_Bits_Rock_L_Diamond" && _cutChance > 1) then {
  2075. playSound3D ["CG_Jobs\sounds\mining\mineF2.ogg", player, false, getPosasl (metals select 0), 25, 1, 15];
  2076. mybarrow = createVehicle ["land_wheelcart_f", [0,0,0], [], 0, "NONE"];
  2077. mybarrow attachto [player, [0, 1.3, 0.5] ];
  2078. myIron = createVehicle ["a3l_Bits_Rock_L_Diamond", getpos player, [], 0, "NONE"];
  2079. myIron attachTo [myBarrow, [0, 0.8, 0.85] ];
  2080. };
  2081.  
  2082. };
  2083. };
  2084.  
  2085.  
  2086. fnc_refineMetal1 = {
  2087. totalLogs = 0;
  2088. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  2089. {
  2090. if(_x distance vehspawned < 11) then {
  2091. deletevehicle _x;
  2092. _sound = round(random 5);
  2093. playSound3D ["CG_Jobs\sounds\mining\mineF2.ogg", player, false, getPosasl player, 31, 1, 15];
  2094. sleep 1.5;
  2095. hint "You are refining Ore, stay still!";
  2096. [] spawn fnc_packMetal2;
  2097. };
  2098. } forEach attachedObjects vehspawned;
  2099. };
  2100.  
  2101. fnc_refineMetal2 = {
  2102. totalLogs = 0;
  2103. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  2104. {
  2105. if(_x distance vehspawned < 11) then {
  2106. deletevehicle _x;
  2107. _sound = round(random 5);
  2108. playSound3D ["CG_Jobs\sounds\mining\mineF2.ogg", player, false, getPosasl player, 31, 1, 15];
  2109. sleep 1.5;
  2110. hint "You are refining Metal, stay still!";
  2111. player additem "cg_metalstack";
  2112. };
  2113. } forEach attachedObjects vehspawned;
  2114. hint "Refined Metal placed in inventory";
  2115. };
  2116.  
  2117. fnc_packMetal2 = {
  2118. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  2119. if(totalLogs == 6) exitwith { hint "Load is full!"; };
  2120. mylog = createVehicle ["Land_Pipes_large_F", position player, [], 0, "NONE"];
  2121.  
  2122. totalLogs = totalLogs + 1;
  2123.  
  2124. if(totalLogs == 1) exitwith {
  2125. mylog attachTo [vehspawned, [-0.6, -3.8, 1.1] ]; mylog setdir 90;
  2126. };
  2127. if(totalLogs == 2) exitwith {
  2128. mylog attachTo [vehspawned, [0.6, -3.8, 1.1] ]; mylog setdir 90;
  2129. };
  2130. if(totalLogs == 3) exitwith {
  2131. mylog attachTo [vehspawned, [-0.6, -3.8, 1.7] ]; mylog setdir 90;
  2132. };
  2133. if(totalLogs == 4) exitwith {
  2134. mylog attachTo [vehspawned, [0.6, -3.8, 1.7] ]; mylog setdir 90;
  2135. };
  2136. if(totalLogs == 5) exitwith {
  2137. mylog attachTo [vehspawned, [-0.6, -3.8, 2.3] ];mylog setdir 90;
  2138. };
  2139. if(totalLogs == 6) exitwith {
  2140. mylog attachTo [vehspawned, [0.6, -3.8, 2.3] ]; mylog setdir 90;
  2141. };
  2142. };
  2143.  
  2144.  
  2145.  
  2146. fnc_packMetal1 = {
  2147. if(vehSpawned distance player > 15) exitwith { hint "Your truck is too far away!"; };
  2148. if(totalLogs == 6) exitwith { hint "Load is full!"; };
  2149. mylog = createVehicle ["a3l_Bits_Rock_L_Iron", position player, [], 0, "NONE"];
  2150.  
  2151. totalLogs = totalLogs + 1;
  2152.  
  2153. if(totalLogs == 1) exitwith {
  2154. mylog attachTo [vehspawned, [-0.6, -3.8, 1.7] ]; mylog setdir 90;
  2155. };
  2156. if(totalLogs == 2) exitwith {
  2157. mylog attachTo [vehspawned, [0.6, -3.8, 1.7] ]; mylog setdir 90;
  2158. };
  2159. if(totalLogs == 3) exitwith {
  2160. mylog attachTo [vehspawned, [-0.6, -2.8, 1.7] ]; mylog setdir 90;
  2161. };
  2162. if(totalLogs == 4) exitwith {
  2163. mylog attachTo [vehspawned, [0.6, -2.8, 1.7] ]; mylog setdir 90;
  2164. };
  2165. if(totalLogs == 5) exitwith {
  2166. mylog attachTo [vehspawned, [-0.6, -1.8, 1.7] ];mylog setdir 90;
  2167. };
  2168. if(totalLogs == 6) exitwith {
  2169. mylog attachTo [vehspawned, [0.6, -1.8, 1.7] ]; mylog setdir 90;
  2170. };
  2171. };
  2172.  
  2173.  
  2174.  
  2175. fnc_trucking = {
  2176.  
  2177. towvehiclelist = ["IVORY_PRIUS","ivory_gt500","ivory_wrx","ivory_lp560","IVORY_R8","IVORY_R8SPYDER","IVORY_REV","ivory_lfa","ivory_c"];
  2178.  
  2179.  
  2180. while{trucking} do {
  2181.  
  2182. ["A truck delivery location will be picked shortly!", false] spawn domsg;
  2183. _jail = false;
  2184.  
  2185. chosen = ["Truck_Stop_1","Truck_Stop_2","Truck_Stop_3","Truck_Stop_4","Truck_Stop_5","Truck_Stop_6","Truck_Stop_7","Truck_Stop_8","Truck_Stop_9","Truck_Stop_10"] call BIS_fnc_selectRandom;
  2186. chosen2 = chosen;
  2187. chosen = (getmarkerpos chosen);
  2188. _distance = player distance chosen;
  2189. _distance = floor (_distance / 1000);
  2190.  
  2191. if(_distance < 1) then { _distance = 1; };
  2192. if(_distance > 8) then { _distance = 8; };
  2193. _success = false;
  2194. _calcT = 0;
  2195. while {trucking} do {
  2196. _calcT = _calcT + 1;
  2197.  
  2198. if(player distance chosen < 10) exitwith {
  2199. _success = true;
  2200. };
  2201. if(_calcT > 1200) exitwith {};
  2202. uisleep 1;
  2203. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You have taken %1 of 1200 seconds. <br/> Your job marker is %2",_calcT,chosen2];
  2204. };
  2205. ["You are close, stop, jump out and unhitch your trailers!", false] spawn domsg;
  2206. sleep 3;
  2207. _goodT = _distance * 20;
  2208. _goodT = _goodT - _calcT;
  2209. _payment = _goodT * 50;
  2210. if(_payment < 2300) then { _payment = 2300; };
  2211. if(_payment > 8220) then { _payment = 8220; };
  2212. _groundPhase = 0;
  2213. while {trucking} do {
  2214. if(!_success) exitwith {};
  2215. _groundPhase = _groundPhase + 1;
  2216.  
  2217. if(!_success) exitwith { ["You failed this mission, stay inside your vehicle until you are close enough to the point.", false] spawn domsg; };
  2218.  
  2219. if(vehicle player isEqualTo player && _success && player distance chosen < 35 && (vehspawned distance player < 30) ) exitwith {
  2220. ["Add",25] call fnc_karma;
  2221. ["bank","add", _payment] call life_fnc_handleCash;
  2222. [format["You just got paid %1 your delivery!",_payment], false] spawn domsg;
  2223. };
  2224.  
  2225. if(_groundPhase > 600) exitwith { ["You took to long to finish the trailer hitching!", false] spawn domsg; };
  2226. uisleep 0.1;
  2227. };
  2228.  
  2229. _remaining = 150 - _calcT;
  2230. if(_remaining < 30) then {
  2231. _remaining = 30;
  2232. };
  2233. while {_remaining > 0 && trucking} do {
  2234. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You will receive a new job in %1 seconds.",_remaining];
  2235. uisleep 1;
  2236. _remaining = _remaining - 1;
  2237. };
  2238. };
  2239.  
  2240. _remaining = 60;
  2241.  
  2242. while {_remaining > 0 && trucking} do {
  2243. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> Your vehicle despawns in %1 seconds!",_remaining];
  2244. uisleep 1;
  2245. _remaining = _remaining - 1;
  2246. };
  2247.  
  2248. player allowdamage false;
  2249. sleep 1;
  2250. player setpos (getMarkerPos "Truck_Jobs");
  2251. ["Your deliveries have finished!", false] spawn domsg;
  2252. player allowdamage true;
  2253. };
  2254.  
  2255.  
  2256.  
  2257.  
  2258.  
  2259.  
  2260.  
  2261.  
  2262. fnc_startGarbage = {
  2263.  
  2264. private["_oldBinDir","_oldBinPos"];
  2265.  
  2266. _nearBin = nearestObjects[getPos player,["Land_Dumpster_DED_Dumpster_01_F"],6];
  2267. _isBin = count _nearBin;
  2268.  
  2269. if(_isBin > 0) then {
  2270.  
  2271. _isBinSelected = _nearBin select 0;
  2272. _oldBinPos = getpos _isBinSelected;
  2273. _oldBinDir = getdir _isBinSelected;
  2274. deletevehicle _isBinSelected;
  2275. _veh = vehicle player;
  2276.  
  2277. if(_veh == player) exitwith {};
  2278.  
  2279. _veh setfuel 0;
  2280. _veh animate ['contenedor_unhide',1];
  2281. _veh animate ['contenedor',1];
  2282. _veh animate ['tapacontenedor',1];
  2283. sleep 3;
  2284. _veh animate ['contenedor',0];
  2285. _veh animate ['tapacontenedor',0];
  2286. sleep 3;
  2287. _veh animate ['contenedor_unhide',0];
  2288. sleep 3;
  2289. _veh animate ['pala',0];
  2290. _veh animate ['hidraulicos',0];
  2291. _veh animate ['hidraulicos2',0];
  2292. sleep 1;
  2293. _veh animate ['porton',1];
  2294. _veh animate ['basura_unhide',1];
  2295. [_veh, "Hidraulics",100] call CBA_fnc_globalSay3d;
  2296. sleep 7;
  2297. _veh animate ['pala',1];
  2298. _veh animate ['hidraulicos',1];
  2299. _veh animate ['hidraulicos2',1];
  2300. sleep 2;
  2301. [_veh, "Hidraulics",100] call CBA_fnc_globalSay3d;
  2302. _veh animate ['porton',0];
  2303. sleep 7;
  2304. _veh animate ['pala',1];
  2305. _veh animate ['hidraulicos',1];
  2306. _veh animate ['hidraulicos2',1];
  2307. sleep 1;
  2308. _veh animate ['basura_unhide',0];
  2309. _veh setfuel 1;
  2310. sleep 5;
  2311. _newBin = createVehicle ["Land_Dumpster_DED_Dumpster_01_F", _oldBinPos, [], 0, "NONE"];
  2312. _newBin setdir _oldBinDir;
  2313.  
  2314. } else {
  2315.  
  2316. hint "There is no garbage near you!";
  2317.  
  2318. };
  2319.  
  2320. };
  2321.  
  2322.  
  2323.  
  2324.  
  2325.  
  2326.  
  2327.  
  2328.  
  2329.  
  2330.  
  2331. fnc_maintstart = {
  2332. if(side player == west) exitwith {};
  2333. player forceAddUniform "TRYK_HRP_USMC";
  2334. _success = true;
  2335.  
  2336. if(farm) then {
  2337. airvehspawned = createVehicle ["ivory_tractor", position player, [], 0, "NONE"];
  2338. [airvehspawned] spawn life_fnc_clearVehicleAmmo;
  2339. oiljobs = [(getpos wheat1),(getpos wheat2),(getpos wheat3),(getpos wheat4),(getpos wheat5),(getpos wheat6),(getpos wheat7),(getpos wheat8),(getpos wheat9),(getpos wheat10),(getpos wheat11),(getpos wheat12),(getpos wheat13),(getpos wheat14),(getpos wheat15),(getpos wheat16),(getpos wheat17)];
  2340. bullshit_story = [
  2341. "Go cut down the wheat in this area!",
  2342. "Spray pesticide on the marker!",
  2343. "Some tools need to be delivered to a work spot! Check your map!",
  2344. "Drop off some food supplies for animals!",
  2345. "Someone reported a fire on our farm? Surely its a joke, check please!",
  2346. "We heard our crops have pests, check it out please!",
  2347. "We have reports of chemical spillage at the marked location, can you check please?"
  2348. ];
  2349. };
  2350. if (oil) then {
  2351. airvehspawned = createVehicle ["ivory_b206", position player, [], 0, "NONE"];
  2352. [airvehspawned] spawn life_fnc_clearVehicleAmmo;
  2353. oiljobs = [(getpos oilrig1),(getpos oilrig2),(getpos oilrig3),(getpos oilrig4),(getpos oilrig5),(getpos oilrig6),(getpos oilrig7)];
  2354. bullshit_story = [
  2355. "A marker has been put down where medical supplies need to be delivered!",
  2356. "Some tools need to be delivered to a work spot! Check your map!",
  2357. "Drop off some food supplies for workers, ASAP please!",
  2358. "Some papers need signing off, take these to the marked location!",
  2359. "We need you to check out workers at this location!",
  2360. "We have reports of oil leakage at the marked location, can you check please?"
  2361. ];
  2362. };
  2363.  
  2364.  
  2365.  
  2366. player action ["getInDriver", airvehspawned];
  2367. while{maintenance_on && _success} do {
  2368.  
  2369. if(player distance airvehspawned > 500 || deadPlayer) exitwith {};
  2370. chosen = oiljobs call BIS_fnc_selectRandom;
  2371. [bullshit_story call BIS_fnc_selectRandom, false] spawn domsg;
  2372. playSound "ringing";
  2373. markerf = createMarkerLocal ["themarker",chosen];
  2374. markerf setMarkerColorLocal "ColorRed";
  2375. markerf setMarkerTypeLocal "Mil_dot";
  2376. markerf setMarkerTextLocal "*** Next Job ***";
  2377.  
  2378. ["Maintenance",chosen] spawn fnc_draw3d;
  2379.  
  2380. _distance = player distance chosen;
  2381. _distance = floor (_distance / 1000);
  2382.  
  2383. if(_distance < 1) then { _distance = 1; };
  2384. if(_distance > 8) then { _distance = 8; };
  2385.  
  2386. _calcT = 0;
  2387. while {maintenance_on} do {
  2388. if(player distance airvehspawned > 500 || deadPlayer) exitwith {};
  2389. _calcT = _calcT + 1;
  2390. markerf setMarkerPosLocal (chosen);
  2391.  
  2392. if(player distance chosen < 100 && oil ) exitwith {
  2393. _success = true;
  2394. ["You are close, land safely and finish the work!", false] spawn domsg;
  2395. };
  2396. if(player distance chosen < 5 && farm && typeOf(vehicle player) == "ivory_tractor") exitwith {
  2397. _success = true;
  2398. ["Get close to the marker and finish the work!", false] spawn domsg;
  2399. };
  2400.  
  2401. if(_calcT > 360) exitwith { _success = false; ["You failed to finish the job!", false] spawn domsg; };
  2402. uisleep 1;
  2403. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You have taken %1 seconds.",_calcT];
  2404. };
  2405. hint "";
  2406. sleep 1;
  2407.  
  2408. _goodT = _distance * 7;
  2409. _goodT = _goodT - _calcT;
  2410. _payment = _goodT * 50;
  2411.  
  2412.  
  2413.  
  2414. if(farm) then {
  2415. _payment = 110;
  2416. };
  2417. if (oil) then {
  2418. if(_payment < 300) then { _payment = 300; };
  2419. if(_payment > 450) then { _payment = 450; };
  2420. };
  2421. _groundPhase = 0;
  2422. while {maintenance_on} do {
  2423. if(player distance airvehspawned > 500 || deadPlayer) exitwith {};
  2424. if(!_success) exitwith {};
  2425. _groundPhase = _groundPhase + 1;
  2426. markerf setMarkerPosLocal (chosen);
  2427.  
  2428. if(!_success) exitwith { ["You failed this mission, stay inside your vehicle until you are close enough to marked point.", false] spawn domsg; };
  2429. if(vehicle player == player && player distance chosen < 55 && oil) exitwith {
  2430. player playmove "AmovPercMrunSnonWnonDf_AmovPercMstpSnonWnonDnon_gthEnd";
  2431. ["bank","add", _payment] call life_fnc_handleCash;
  2432. [format["You just got paid %1 for your help!",_payment], false] spawn domsg;
  2433. ["Add",1] call fnc_karma;
  2434. };
  2435. if(player distance chosen < 3 && farm && typeOf(vehicle player) == "ivory_tractor") exitwith {
  2436. ["bank","add", _payment] call life_fnc_handleCash;
  2437. [format["You just got paid %1 for your help!",_payment], false] spawn domsg;
  2438. ["Add",1] call fnc_karma;
  2439. };
  2440. if(_groundPhase > 60) exitwith { ["You took to long!!", false] spawn domsg; };
  2441. uisleep 1;
  2442. };
  2443.  
  2444. deleteMarkerLocal "themarker";
  2445.  
  2446. _remaining = 5;
  2447.  
  2448. while {_remaining > 0 && maintenance_on} do {
  2449. if(player distance airvehspawned > 500) exitwith {};
  2450. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You will receive a new task in %1 seconds.",_remaining];
  2451. uisleep 1;
  2452. _remaining = _remaining - 1;
  2453. };
  2454. if(!_success) exitwith { maintenance_on = false; };
  2455. };
  2456.  
  2457.  
  2458. _remaining = 60;
  2459.  
  2460. while {_remaining > 0} do {
  2461. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> Your vehicle despawns in %1 seconds!",_remaining];
  2462. uisleep 1;
  2463. _remaining = _remaining - 1;
  2464. };
  2465.  
  2466. maintenance_on = false;
  2467. player allowdamage false;
  2468. sleep 0.05;
  2469. _newpos = getpos airvehspawned;
  2470. airvehspawned setVelocity [0, 0, 0];
  2471. deletevehicle airvehspawned;
  2472. player setpos [_newpos select 0, _newpos select 1, 0];
  2473. sleep 0.05;
  2474. player allowdamage true;
  2475. ["You have been laid off from your Job!", false] spawn domsg;
  2476. };
  2477.  
  2478.  
  2479. fnc_fedex = {
  2480.  
  2481. while{fedex_on} do {
  2482.  
  2483. ["A new job will be placed on your map shortly - STAY INSIDE YOUR VEHICLE UNTIL NEAR THE PERSON!", false] spawn domsg;
  2484. sleep 3;
  2485. _jail = false;
  2486. while {fedex_on} do
  2487. {
  2488. chosen = playableUnits call BIS_fnc_selectRandom;
  2489. if ((isPlayer chosen) && (side chosen == civilian) && (chosen != player)) exitWith {};
  2490. sleep 1;
  2491. playSound "ringing";
  2492. };
  2493. markerf = createMarkerLocal ["themarker",visiblePosition chosen];
  2494. markerf setMarkerColorLocal "ColorRed";
  2495. markerf setMarkerTypeLocal "Mil_dot";
  2496. markerf setMarkerTextLocal format["%1", chosen getVariable["realname",name chosen]];
  2497. _distance = player distance chosen;
  2498. _distance = floor (_distance / 1000);
  2499. if( uniform chosen isEqualTo "A3L_Prisoner_Outfit" && (chosen distance (getMarkerPos "shank_1")) < 20 ) then {
  2500. ["This player appears to be in prison, get close to the walls to deliver their package.", false] spawn domsg;
  2501. };
  2502. if(_distance < 1) then { _distance = 1; };
  2503. if(_distance > 8) then { _distance = 8; };
  2504. _success = false;
  2505. _calcT = 0;
  2506. while {fedex_on} do {
  2507. _calcT = _calcT + 1;
  2508. markerf setMarkerPosLocal (visiblePosition chosen);
  2509. if( uniform chosen isEqualTo "A3L_Prisoner_Outfit" && (chosen distance (getMarkerPos "shank_1")) < 20 && player distance chosen < 50 ) exitwith {
  2510. _success = true;
  2511. _jail = true;
  2512. };
  2513. if(player distance chosen < 10) exitwith {
  2514. _success = true;
  2515. };
  2516. if ((!isPlayer chosen) && (side chosen != civilian)) exitWith {};
  2517. if((chosen getVariable["dead",FALSE])) exitwith {};
  2518. if(_calcT > 480) exitwith {};
  2519. uisleep 1;
  2520. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You have taken %1 seconds.",_calcT];
  2521. };
  2522. ["You are close, jump out and finish the mission!", false] spawn domsg;
  2523. sleep 3;
  2524. _goodT = _distance * 7;
  2525. _goodT = _goodT - _calcT;
  2526. _payment = _goodT * 50;
  2527. if(_payment < 600) then { _payment = 600; };
  2528. if(_payment > 2220) then { _payment = 2220; };
  2529. _groundPhase = 0;
  2530. while {fedex_on} do {
  2531. if(!_success) exitwith {};
  2532. _groundPhase = _groundPhase + 1;
  2533. markerf setMarkerPosLocal (visiblePosition chosen);
  2534. if( _jail && vehicle player isEqualTo player && player distance chosen < 50 ) exitwith {
  2535. "jail" remoteExecCall ["fnc_delivery",chosen];
  2536. ["bank","add", _payment] call life_fnc_handleCash;
  2537. _msg = format["You just got paid %1 your delivery!",_payment];
  2538. [_msg, false] spawn domsg;
  2539. };
  2540. if(!_success) exitwith { ["You failed this mission, stay inside your vehicle until you are close enough to marked point.", false] spawn domsg; };
  2541. if(vehicle player isEqualTo player && _success && player distance chosen < 15 && vehicle chosen isEqualTo chosen) exitwith {
  2542. player playmove "AmovPercMrunSnonWnonDf_AmovPercMstpSnonWnonDnon_gthEnd";
  2543. ["bank","add", _payment] call life_fnc_handleCash;
  2544. _msg = format["You just got paid %1 your delivery!",_payment];
  2545. [_msg, false] spawn domsg;
  2546. if(typeOf(vehicle player) isEqualTo "critgamin_vangmcc_fedex") then {
  2547. "standard" remoteExecCall ["fnc_delivery",chosen];
  2548. ["Add",1] call fnc_karma;
  2549. };
  2550. if(typeOf(vehicle player) isEqualTo "critgamin_vangmcc_pizza") then {
  2551. "fastfood" remoteExecCall ["fnc_delivery",chosen];
  2552. ["Add",1] call fnc_karma;
  2553. };
  2554. if(typeOf(vehicle player) isEqualTo "critgamin_vangmcc_fixit") then {
  2555. "fixit" remoteExecCall ["fnc_delivery",chosen];
  2556. ["Add",1] call fnc_karma;
  2557. };
  2558. //function for target unit to get a random gift on delivery.
  2559. };
  2560. if(_groundPhase > 60) exitwith { ["You took to long to finish the mission!", false] spawn domsg; };
  2561. uisleep 1;
  2562. };
  2563.  
  2564. deleteMarkerLocal "themarker";
  2565.  
  2566. _remaining = 150 - _calcT;
  2567. if(_remaining < 30) then {
  2568. _remaining = 30;
  2569. };
  2570. while {_remaining > 0} do {
  2571. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> You will receive a new job in %1 seconds.",_remaining];
  2572. uisleep 1;
  2573. _remaining = _remaining - 1;
  2574. };
  2575. };
  2576. _remaining = 60;
  2577.  
  2578. while {_remaining > 0} do {
  2579. hint parsetext format["<img size='1' image='icons\info.paa'/> <t color='#FFCC00'><t size='0.75'>JOB:</t><br/> Your vehicle despawns in %1 seconds!",_remaining];
  2580. uisleep 1;
  2581. _remaining = _remaining - 1;
  2582. };
  2583. player allowdamage false;
  2584. sleep 1;
  2585. player setpos (getMarkerPos "job_spawn_1");
  2586. ["Your deliveries have finished!", false] spawn domsg;
  2587. player allowdamage true;
  2588. };
  2589.  
  2590.  
  2591.  
  2592.  
  2593. fnc_trytaxi = {
  2594.  
  2595. if(life_taxi) exitwith { ["You are a taxi driver..?", false] spawn domsg; };
  2596. if(checked_taxi) exitwith { ["You called a taxi recently, please wait!", false] spawn domsg; };
  2597. checked_taxi = true;
  2598. player remoteExec ["fnc_taxi",civilian];
  2599. ["You have called a taxi, please wait!", false] spawn domsg;
  2600. sleep 300;
  2601. checked_taxi = false;
  2602. };
  2603.  
  2604. fnc_taxi = {
  2605. if(!life_taxi) exitwith {};
  2606. _unit = _this;
  2607.  
  2608. _dMarker = createMarkerLocal [format["%1_marker",_unit],visiblePosition _unit];
  2609. _dMarker setMarkerTypeLocal "hd_warning";
  2610. _dMarker setMarkerTextLocal format["Taxi Call: %1", _unit getVariable["realname",name _unit]];
  2611. _dMarker setMarkerColorLocal "ColorWhite";
  2612. playSound "ringing";
  2613. ["Someone has called a Taxi! Check your Map!"] spawn domsg;
  2614. _skip = false;
  2615. _somecounter = 1;
  2616. while{true} do {
  2617. if(typeOf(vehicle player) != "CG_Taxi") exitwith { _skip = true; ["You missed a call!"] spawn domsg; };
  2618. if (player distance _unit < 10) exitwith { ["You are next to your pickup, wait for them to get in!"] spawn domsg; };
  2619.  
  2620. if (vehicle _unit != _unit) exitwith {
  2621. _skip = true;
  2622. if (player distance _unit < 500) then {
  2623. ["You got paid for being near a person who needed a taxi!"] spawn domsg;
  2624. ["It appears they were picked up by someone else! +$1000"] spawn domsg;
  2625. ["cash","add",1000] call life_fnc_handleCash;
  2626. };
  2627. };
  2628. if(!life_taxi) exitwith {};
  2629. if(_somecounter > 600) exitwith {};
  2630. _dMarker setMarkerPosLocal (visiblePosition _unit);
  2631. _somecounter = _somecounter + 1;
  2632. sleep 1;
  2633. };
  2634. theirTotal = _somecounter * 5;
  2635. _somecounter = 1;
  2636. while{true} do {
  2637. if(_skip || !life_taxi) exitwith {};
  2638.  
  2639. _dMarker setMarkerPosLocal (visiblePosition _unit);
  2640. if(vehicle _unit != _unit) exitwith {
  2641. _crew = crew (vehicle player);
  2642. {
  2643. if(_x == _unit) then
  2644. {
  2645. ["cash","add",theirTotal] call life_fnc_handleCash;
  2646. [format["A person requesting a taxi got in your vehicle - you got paid %1 !",theirTotal], false] spawn domsg;
  2647. life_taxi = false;
  2648. };
  2649. } foreach _crew;
  2650. };
  2651. if(_somecounter > 25) exitwith {};
  2652. sleep 1;
  2653. _somecounter = _somecounter + 1;
  2654. };
  2655. deleteMarkerLocal format["%1_marker",_unit];
  2656. };
  2657.  
  2658.  
  2659. fnc_Pull_ID =
  2660. {
  2661. _cop = _this;
  2662.  
  2663. [format["Your ID is being checked by %1",name _cop], false] spawn domsg;
  2664.  
  2665. disableUserInput true;
  2666. safe_licenses = ["license_civ_driver", "license_civ_air", "license_civ_boat", "license_civ_dive", "license_civ_truck", "license_civ_gun", "license_civ_rifle"];
  2667.  
  2668. _licenses = "";
  2669.  
  2670. {
  2671. if(missionNamespace getVariable (_x select 0) && _x select 1 == "civ" && _x select 0 IN safe_licenses) then
  2672. {
  2673. _licenses = _licenses + ([_x select 0] call life_fnc_varToStr) + " | ";
  2674. };
  2675. } foreach life_licenses;
  2676.  
  2677. [_licenses,life_houses] remoteExecCall ["fnc_give_ID",_cop];
  2678. sleep 10;
  2679.  
  2680. disableUserInput false;
  2681. };
  2682.  
  2683. fnc_give_ID =
  2684. {
  2685. if(count target_houses > 0) then {
  2686. [] call fnc_del_houses;
  2687. };
  2688. target_licenses = _this select 0;
  2689. target_houses = _this select 1;
  2690. _n = 0;
  2691. if(count target_houses > 0) then {
  2692.  
  2693. {
  2694. _pos = call compile format["%1",_x select 0];
  2695. _house = nearestBuilding _pos;
  2696. _houseName = getText(configFile >> "CfgVehicles" >> (typeOf _house) >> "displayName");
  2697. _marker = createMarkerLocal [format["house_%1",_n],_pos];
  2698. _marker setMarkerTextLocal _houseName;
  2699. _marker setMarkerColorLocal "ColorRed";
  2700. _marker setMarkerTypeLocal "loc_Lighthouse";
  2701. _n = _n + 1;
  2702. } foreach target_houses;
  2703.  
  2704. ["The players houses have been marked on the map!", false] spawn domsg;
  2705.  
  2706. };
  2707. life_gather_info = true;
  2708. };
  2709.  
  2710.  
  2711.  
  2712.  
  2713. fnc_virt_dupe = {
  2714. private["_theveh","_unitveh","_myveh","_side","_radius","_nearestunits","_nearestunitofside","_unit"];
  2715. _curtarget = cursortarget;
  2716. life_action_inuse = true;
  2717. //set variable to server pending on object
  2718. if(vehicle player != player) then { _curtarget = vehicle player; } else { _curTarget = cursortarget; };
  2719. _uid = getplayerUID player;
  2720. _curTarget setVariable["vehopen",_uid,true];
  2721. //run check for same variable for 2 seconds
  2722. _penis = 8;
  2723. while{_penis > 0} do
  2724. {
  2725. _check = _curTarget getVariable "vehopen";
  2726. if(_check != _uid) exitwith { closedialog 0; life_action_inuse = false; ["Inventory closed due to dupe protection", false] spawn domsg;};
  2727. sleep 0.25;
  2728. _penis = _penis - 1;
  2729. };
  2730. life_action_inuse = false;
  2731. //clear variable and end.
  2732. _curTarget setVariable["vehopen",0,true];
  2733. };
  2734.  
  2735.  
  2736.  
  2737. fnc_item_CG = {
  2738. _idc = ctrlIDC (_this select 0);
  2739. _selectedIndex = _this select 1;
  2740. _unit = player;
  2741. _item = lbData [_idc, _selectedIndex];
  2742.  
  2743. if (_item == "CG_Spikes_Collapsed") then { [true] spawn fnc_spikeStrip_cg; [_item] spawn fnc_removeitem; closeDialog 0; };
  2744. if (_item == "CG_battery_i") then { life_battery = 200; [_item] spawn fnc_removeitem; playSound3D ["cg_sndimg\sounds\phoneSMS.ogg", player, false, getPosASL player, 1, 1, 25]; closeDialog 0; };
  2745. if (_item == "CG_ATF_Pizza_Box_i") then { [true] spawn life_fnc_pizza; [_item] spawn fnc_removeitem; closeDialog 0; };
  2746. if (_item == "CG_ATF_Donut_Box_i") then { [true] spawn life_fnc_bronutsbrah; [_item] spawn fnc_removeitem; closeDialog 0; };
  2747. if (_item == "CG_ATF_Handcuffs_i") then { ["You can restrain with these...", false] spawn domsg; closeDialog 0; };
  2748. if (_item == "CG_Pro_Item_i") then { [] spawn fnc_GoPro; closeDialog 0; };
  2749. if (_item == "CG_ATF_Drug_Bottle_01_i") then { [_item] spawn fnc_removeitem; player forceWalk false; [player,"pillswallow"] spawn life_fnc_nearestSound; player setVariable["severeInjuries", nil, true]; closeDialog 0; };
  2750. false
  2751. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement