Advertisement
CHAINGUN427

init.sqf

Jun 4th, 2014
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.71 KB | None | 0 0
  1. waitUntil {!isNil "dayz_animalCheck"};
  2. sleep 1;
  3.  
  4. /* ******************************************************************************************************************************************* */
  5. /* Turn debugging functionality on or off. */
  6. /* ******************************************************************************************************************************************* */
  7. tfv_DEBUGGING = true;
  8.  
  9. /* ******************************************************************************************************************************************* */
  10. /* How many weapons will be sold per cycle. */
  11. /* ******************************************************************************************************************************************* */
  12. tfv_SALES_PER_ANIM = 5;
  13.  
  14. /* ******************************************************************************************************************************************* */
  15. /* How many magazines will be sold per cycle. */
  16. /* ******************************************************************************************************************************************* */
  17. tfv_SALES_PER_ANIM_MAGS = 10;
  18.  
  19. /* ******************************************************************************************************************************************* */
  20. /* A list of each trader, along with the weapons they accept. */
  21. /* ******************************************************************************************************************************************* */
  22.  
  23. tfv_TRADERS_ITEMS = [
  24. ["RU_Policeman",["M9SD","glock17_EP1","Colt1911","M9","MakarovSD","revolver_gold_EP1","Makarov","revolver_EP1","Winchester1866","MR43","Crossbow_DZ","M1014","Remington870_lamp","LeeEnfield","15Rnd_9x19_M9","15Rnd_9x19_M9SD","17Rnd_9x19_glock17","6Rnd_45ACP","7Rnd_45ACP_1911","8Rnd_9x18_Makarov","8Rnd_9x18_MakarovSD","15Rnd_W1866_Slug","2Rnd_shotgun_74Pellets","2Rnd_shotgun_74Slug","8Rnd_B_Beneli_74Slug","8Rnd_B_Beneli_74Pellets","Quiver","10x_303],["weapons","magazines"]]
  25.  
  26.  
  27. ]; if (tfv_DEBUGGING) then { diag_log "tfv - Traders and their weapons loaded in!"; };
  28.  
  29. /* ******************************************************************************************************************************************* */
  30. /* List of ALL weapons, regardless of trader, along with the prices. */
  31. /* ******************************************************************************************************************************************* */
  32.  
  33. tfv_TRADERS_PRICES = [
  34. ["AKS_74_kobra",200],
  35. ["AKS_74_kobra",200],
  36. ["AKS_74_kobra",200],
  37. ["AKS_74_kobra",200],
  38. ["AKS_74_U",100],
  39. ["AKS_74_U",100],
  40. ["AKS_74_U",100],
  41. ["AKS_74_U",100],
  42. ["AK_47_M",600],
  43. ["AK_47_M",600],
  44. ["AK_47_M",600],
  45. ["AK_47_M",600],
  46. ["AK_74",100],
  47. ["AK_74",100],
  48. ["AK_74",100],
  49. ["AK_74",100],
  50. ["BAF_L85A2_RIS_Holo",600],
  51. ["BAF_L85A2_RIS_Holo",600],
  52. ["BAF_L85A2_RIS_Holo",600],
  53. ["BAF_L85A2_RIS_Holo",600],
  54. ["BAF_L85A2_RIS_SUSAT",300],
  55. ["BAF_L85A2_RIS_SUSAT",300],
  56. ["BAF_L85A2_RIS_SUSAT",300],
  57. ["BAF_L85A2_RIS_SUSAT",300],
  58. ["BAF_LRR_scoped",2000],
  59. ["BAF_LRR_scoped",2000],
  60. ["Binocular",1],
  61. ["Binocular",1],
  62. ["Binocular",1],
  63. ["Binocular",1],
  64. ["Binocular",1],
  65. ["Binocular_Vector",100],
  66. ["Binocular_Vector",100],
  67. ["Binocular_Vector",100],
  68. ["Binocular_Vector",100],
  69. ["Binocular_Vector",100],
  70. ["bizon",500],
  71. ["bizon",500],
  72. ["bizon",500],
  73. ["bizon",500],
  74. ["bizon_silenced",500],
  75. ["bizon_silenced",500],
  76. ["bizon_silenced",500],
  77. ["bizon_silenced",500],
  78. ["Colt1911",10],
  79. ["Colt1911",10],
  80. ["Colt1911",10],
  81. ["Colt1911",10],
  82. ["Crossbow_DZ",5],
  83. ["Crossbow_DZ",5],
  84. ["Crossbow_DZ",5],
  85. ["Crossbow_DZ",5],
  86. ["FN_FAL",500],
  87. ["FN_FAL",500],
  88. ["FN_FAL",500],
  89. ["FN_FAL",500],
  90. ["FN_FAL",500],
  91. ["FN_FAL",500],
  92. ["FN_FAL_ANPVS4",1000],
  93. ["FN_FAL_ANPVS4",1000],
  94. ["G36A_camo",300],
  95. ["G36A_camo",300],
  96. ["G36A_camo",300],
  97. ["G36A_camo",300],
  98. ["G36C",200],
  99. ["G36C",200],
  100. ["G36C",200],
  101. ["G36C",200],
  102. ["G36C_camo",300],
  103. ["G36C_camo",300],
  104. ["G36C_camo",300],
  105. ["G36C_camo",300],
  106. ["G36K_camo",300],
  107. ["G36K_camo",300],
  108. ["G36K_camo",300],
  109. ["G36K_camo",300],
  110. ["G36_C_SD_camo",500],
  111. ["G36_C_SD_camo",500],
  112. ["glock17_EP1",50],
  113. ["glock17_EP1",50],
  114. ["glock17_EP1",50],
  115. ["glock17_EP1",50],
  116. ["huntingrifle",100],
  117. ["huntingrifle",100],
  118. ["huntingrifle",100],
  119. ["huntingrifle",100],
  120. ["ItemCompass",3],
  121. ["ItemCompass",3],
  122. ["ItemCompass",3],
  123. ["ItemCompass",3],
  124. ["ItemCompass",3],
  125. ["ItemCrowbar",1],
  126. ["ItemCrowbar",1],
  127. ["ItemCrowbar",1],
  128. ["ItemCrowbar",1],
  129. ["ItemCrowbar",1],
  130. ["ItemEtool",60],
  131. ["ItemEtool",60],
  132. ["ItemEtool",60],
  133. ["ItemEtool",60],
  134. ["ItemEtool",60],
  135. ["ItemFishingPole",10],
  136. ["ItemFishingPole",10],
  137. ["ItemFishingPole",10],
  138. ["ItemFishingPole",10],
  139. ["ItemFishingPole",10],
  140. ["ItemFlashlight",1],
  141. ["ItemFlashlight",1],
  142. ["ItemFlashlight",1],
  143. ["ItemFlashlight",1],
  144. ["ItemFlashlight",1],
  145. ["ItemFlashlightRed",5],
  146. ["ItemFlashlightRed",5],
  147. ["ItemFlashlightRed",5],
  148. ["ItemFlashlightRed",5],
  149. ["ItemFlashlightRed",5],
  150. ["ItemGPS",100],
  151. ["ItemGPS",100],
  152. ["ItemGPS",100],
  153. ["ItemGPS",100],
  154. ["ItemGPS",100],
  155. ["ItemHatchet_DZE",1],
  156. ["ItemHatchet_DZE",1],
  157. ["ItemHatchet_DZE",1],
  158. ["ItemHatchet_DZE",1],
  159. ["ItemHatchet_DZE",1],
  160. ["ItemKnife",1],
  161. ["ItemKnife",1],
  162. ["ItemKnife",1],
  163. ["ItemKnife",1],
  164. ItemKnife",1],
  165. ["ItemMachete",1],
  166. ["ItemMachete",1],
  167. ["ItemMachete",1],
  168. ["ItemMachete",1],
  169. ["ItemMachete",1],
  170. ["ItemMap",3],
  171. ["ItemMap",3],
  172. ["ItemMap",3],
  173. ["ItemMap",3],
  174. ["ItemMap",3],
  175. ["ItemMatchbox_DZE",1],
  176. ["ItemMatchbox_DZE",1],
  177. ["ItemMatchbox_DZE",1],
  178. ["ItemMatchbox_DZE",1],
  179. ["ItemMatchbox_DZE",1],
  180. ["ItemToolbox",1],
  181. ["ItemToolbox",1],
  182. ["ItemToolbox",1],
  183. ["ItemToolbox",1],
  184. ["ItemToolbox",1],
  185. ["ItemWatch",1],
  186. ["ItemWatch",1],
  187. ["ItemWatch",1],
  188. ["ItemWatch",1],
  189. ["ItemWatch",1],
  190. ["KSVK_DZE",1000],
  191. ["KSVK_DZE",1000],
  192. ["KSVK_DZE",1000],
  193. ["KSVK_DZE",1000],
  194. ["LeeEnfield",10],
  195. ["LeeEnfield",10],
  196. ["LeeEnfield",10],
  197. ["LeeEnfield",10],
  198. ["M1014",200],
  199. ["M1014",200],
  200. ["M1014",200],
  201. ["M1014",200],
  202. ["M14_EP1",1000],
  203. ["M14_EP1",1000],
  204. ["M14_EP1",1000],
  205. ["M14_EP1",1000],
  206. ["M16A2",100],
  207. ["M16A2",100],
  208. ["M16A2",100],
  209. ["M16A2",100],
  210. ["M16A2GL",200],
  211. ["M16A2GL",200],
  212. ["M16A2GL",200],
  213. ["M16A2GL",200],
  214. ["M16A4_ACG",200],
  215. ["M16A4_ACG",200],
  216. ["M16A4_ACG",200],
  217. ["M16A4_ACG",200],
  218. ["M24",600],
  219. ["M24",600],
  220. ["M24",600],
  221. ["M24",600],
  222. ["M240_DZ",500],
  223. ["M240_DZ",500],
  224. ["M240_DZ",500],
  225. ["M240_DZ",500],
  226. ["M240_DZ",500],
  227. ["M240_DZ",500],
  228. ["m240_scoped_EP1_DZE",600],
  229. ["m240_scoped_EP1_DZE",600],
  230. ["m240_scoped_EP1_DZE",600],
  231. ["m240_scoped_EP1_DZE",600],
  232. ["M249_EP1_DZ",600],
  233. ["M249_EP1_DZ",600],
  234. ["M249_EP1_DZ",600],
  235. ["M249_EP1_DZ",600],
  236. ["M249_m145_EP1_DZE",600],
  237. ["M249_m145_EP1_DZE",600],
  238. ["M249_m145_EP1_DZE",600],
  239. ["M249_m145_EP1_DZE",600],
  240. ["M24_des_EP1",600],
  241. ["M24_des_EP1",600],
  242. ["M24_des_EP1",600],
  243. ["M24_des_EP1",600],
  244. ["M24_des_EP1",600],
  245. ["M40A3",600],
  246. ["M40A3",600],
  247. ["M40A3",600],
  248. ["M40A3",600],
  249. ["M4A1",200],
  250. ["M4A1",200],
  251. ["M4A1",200],
  252. ["M4A1",200],
  253. ["M4A1_Aim",400],
  254. ["M4A1_Aim",400],
  255. ["M4A1_Aim",400],
  256. ["M4A1_Aim",400],
  257. ["M4A1_AIM_SD_camo",500],
  258. ["M4A1_AIM_SD_camo",500],
  259. ["M4A1_HWS_GL_camo",400],
  260. ["M4A1_HWS_GL_camo",400],
  261. ["M4A1_HWS_GL_camo",400],
  262. ["M4A1_HWS_GL_camo",400],
  263. ["M4A1_HWS_GL_SD_Camo",1000],
  264. ["M4A1_HWS_GL_SD_Camo",1000],
  265. ["M4A1_HWS_GL_SD_Camo",1000],
  266. ["M4A1_HWS_GL_SD_Camo",1000],
  267. ["M4A3_CCO_EP1",500],
  268. ["M4A3_CCO_EP1",500],
  269. ["M4A3_CCO_EP1",500],
  270. ["M4A3_CCO_EP1",500],
  271. ["M4SPR",600],
  272. ["M4SPR",600],
  273. ["M4SPR",600],
  274. ["M4SPR",600],
  275. ["M60A4_EP1_DZE",1000],
  276. ["M60A4_EP1_DZE",1000],
  277. ["M60A4_EP1_DZE",1000],
  278. ["M60A4_EP1_DZE",1000],
  279. ["m8_carbine",200],
  280. ["m8_compact",200],
  281. ["m8_holo_sd",400],
  282. ["M8_SAW",600],
  283. ["M8_SAW",600],
  284. ["M8_SAW",600],
  285. ["M8_SAW",600],
  286. ["m8_sharpshooter",300],
  287. ["M9",20],
  288. ["M9",20],
  289. ["M9",20],
  290. ["M9",20],
  291. ["M9SD",100],
  292. ["M9SD",100],
  293. ["M9SD",100],
  294. ["M9SD",100],
  295. ["Makarov",10],
  296. ["Makarov",10],
  297. ["Makarov",10],
  298. ["Makarov",10],
  299. ["MakarovSD",100],
  300. ["MakarovSD",100],
  301. ["MakarovSD",100],
  302. ["MakarovSD",100],
  303. ["MG36",600],
  304. ["MG36",600],
  305. ["MG36",600],
  306. ["MG36",600],
  307. ["MG36_camo",600],
  308. ["MG36_camo",600],
  309. ["MG36_camo",600],
  310. ["MG36_camo",600],
  311. ["Mk_48_DZ",1000],
  312. ["Mk_48_DZ",1000],
  313. ["Mk_48_DZ",1000],
  314. ["Mk_48_DZ",1000],
  315. ["Mk_48_DZ",1000],
  316. ["Mk_48_DZ",1000],
  317. ["MP5A5",20],
  318. ["MP5A5",20],
  319. ["MP5A5",20],
  320. ["MP5A5",20],
  321. ["MP5SD",300],
  322. ["MP5SD",300],
  323. ["MP5SD",300],
  324. ["MP5SD",300],
  325. ["MR43",8],
  326. ["MR43",8],
  327. ["MR43",8],
  328. ["MR43",8],
  329. ["NVGoggles",100],
  330. ["NVGoggles",100],
  331. ["NVGoggles",100],
  332. ["NVGoggles",100],
  333. ["NVGoggles",100],
  334. ["Pecheneg_DZ",1000],
  335. ["Pecheneg_DZ",1000],
  336. ["Pecheneg_DZ",1000],
  337. ["Pecheneg_DZ",1000],
  338. ["Remington870_lamp",100],
  339. ["Remington870_lamp",100],
  340. ["Remington870_lamp",100],
  341. ["Remington870_lamp",100],
  342. ["revolver_EP1",10],
  343. ["revolver_EP1",10],
  344. ["revolver_EP1",10],
  345. ["revolver_EP1",10],
  346. ["revolver_gold_EP1",200],
  347. ["revolver_gold_EP1",200],
  348. ["revolver_gold_EP1",200],
  349. ["revolver_gold_EP1",200],
  350. ["RPK_74",600],
  351. ["RPK_74",600],
  352. ["RPK_74",600],
  353. ["RPK_74",600],
  354. ["Sa58P_EP1",100],
  355. ["Sa58P_EP1",100],
  356. ["Sa58P_EP1",100],
  357. ["Sa58P_EP1",100],
  358. ["Sa58V_CCO_EP1",400],
  359. ["Sa58V_CCO_EP1",400],
  360. ["Sa58V_CCO_EP1",400],
  361. ["Sa58V_CCO_EP1",400],
  362. ["Sa58V_EP1",100],
  363. ["Sa58V_EP1",100],
  364. ["Sa58V_EP1",100],
  365. ["Sa58V_EP1",100],
  366. ["Sa58V_RCO_EP1",400],
  367. ["Sa58V_RCO_EP1",400],
  368. ["Sa58V_RCO_EP1",400],
  369. ["Sa58V_RCO_EP1",400],
  370. ["Sa61_EP1",50],
  371. ["Sa61_EP1",50],
  372. ["Sa61_EP1",50],
  373. ["Sa61_EP1",50],
  374. ["Saiga12K",300],
  375. ["SCAR_H_LNG_Sniper_SD",1000],
  376. ["SCAR_H_LNG_Sniper_SD",1000],
  377. ["SVD",600],
  378. ["SVD",600],
  379. ["SVD",600],
  380. ["SVD",600],
  381. ["SVD",600],
  382. ["SVD_CAMO",600],
  383. ["SVD_CAMO",600],
  384. ["SVD_CAMO",600],
  385. ["SVD_CAMO",600],
  386. ["SVD_des_EP1",600],
  387. ["SVD_des_EP1",600],
  388. ["SVD_des_EP1",600],
  389. ["SVD_des_EP1",600],
  390. ["SVD_des_EP1",600],
  391. ["UZI_EP1",200],
  392. ["UZI_EP1",200],
  393. ["UZI_EP1",200],
  394. ["UZI_EP1",200],
  395. ["UZI_SD_EP1",500],
  396. ["UZI_SD_EP1",500],
  397. ["UZI_SD_EP1",500],
  398. ["UZI_SD_EP1",500],
  399. ["VSS_vintorez",400],
  400. ["Winchester1866",10],
  401. ["Winchester1866",10],
  402. ["Winchester1866",10],
  403. ["Winchester1866",10]
  404. ]; if (tfv_DEBUGGING) then { { diag_log format ["tfv - Price loaded - %1",_x]; } forEach tfv_TRADERS_PRICES; };
  405.  
  406. /* ******************************************************************************************************************************************* */
  407. /* Anything below this line was not intended to be modified. */
  408. /* ******************************************************************************************************************************************* */
  409.  
  410. tfv_TRADERS = [];
  411. { tfv_TRADERS set [(count tfv_TRADERS),(_x select 0)]; } forEach tfv_TRADERS_ITEMS;
  412. tfv_TRADERS_TYPES = [];
  413. { tfv_TRADERS_TYPES set [(count tfv_TRADERS_TYPES),(_x select 2)]; } forEach tfv_TRADERS_ITEMS;
  414. if (tfv_DEBUGGING) then { { diag_log format ["tfv - Trader loaded - %1",_x]; } forEach tfv_TRADERS; };
  415. tfv_SALE_SUCCESS_STRING = "Sold %1 weapons from your vehicle";
  416. tfv_SALE_SUCCESS_STRING_MAGS = "Sold %1 items from your vehicle";
  417. tfv_PREP_FOR_TRADE = "Starting trade in %1 seconds, move to cancel";
  418. tfv_CANCELLED_TRADE = "Trade cancelled";
  419. tfv_STARTING_TRADE = "Starting trade";
  420. tfv_TRADE_STEPS = "Trading, stage %1 of %2";
  421. tfv_TRADE_CANCELLED_END = "Trade cancelled\nMake sure your vehicle is empty and isn't moving";
  422. tfv_SIDENOTE = "You were paid an %1";
  423. tfv_VEHICLE_CONFIRM = "Trading from %1";
  424. tfv_NO_WEAPONS = "There is no weapons inside your vehicle (%1)";
  425. tfv_NO_MAGAZINES = "There is no items inside your vehicle (%1)";
  426. tfv_ACTION_INDEX = -1;
  427. tfv_ACTION = 0;
  428. tfv_ACTION_INDEX_MAGS = -1;
  429. tfv_ACTION_MAGS = 0;
  430. tfv_IS_TRADING = false;
  431. tfv_EXCHANGE = [
  432. ["ItemBriefcase100oz",10000],
  433. ["ItemBriefcase90oz",9000],
  434. ["ItemBriefcase80oz",8000],
  435. ["ItemBriefcase70oz",7000],
  436. ["ItemBriefcase60oz",6000],
  437. ["ItemBriefcase50oz",5000],
  438. ["ItemBriefcase40oz",4000],
  439. ["ItemBriefcase30oz",3000],
  440. ["ItemBriefcase20oz",2000],
  441. ["ItemGoldBar10oz",1000],
  442. ["ItemGoldBar9oz",900],
  443. ["ItemGoldBar8oz",800],
  444. ["ItemGoldBar7oz",700],
  445. ["ItemGoldBar6oz",600],
  446. ["ItemGoldBar5oz",500],
  447. ["ItemGoldBar4oz",400],
  448. ["ItemGoldBar3oz",300],
  449. ["ItemGoldBar2oz",200],
  450. ["ItemGoldBar",100],
  451. ["ItemBriefcaseS90oz",90],
  452. ["ItemBriefcaseS80oz",80],
  453. ["ItemBriefcaseS70oz",70],
  454. ["ItemBriefcaseS60oz",60],
  455. ["ItemBriefcaseS50oz",50],
  456. ["ItemBriefcaseS40oz",40],
  457. ["ItemBriefcaseS30oz",30],
  458. ["ItemBriefcaseS20oz",20],
  459. ["ItemSilverBar10oz",10],
  460. ["ItemSilverBar9oz",9],
  461. ["ItemSilverBar8oz",8],
  462. ["ItemSilverBar7oz",7],
  463. ["ItemSilverBar6oz",6],
  464. ["ItemSilverBar5oz",5],
  465. ["ItemSilverBar4oz",4],
  466. ["ItemSilverBar3oz",3],
  467. ["ItemSilverBar2oz",2],
  468. ["ItemSilverBar",1]
  469. ]; if (tfv_DEBUGGING) then { { diag_log format ["tfv - Exchange loaded - %1",_x]; } forEach tfv_EXCHANGE; };
  470.  
  471. /* ******************************************************************************************************************************************* */
  472. /* Functions. */
  473. /* ******************************************************************************************************************************************* */
  474.  
  475. tfv_fnc_aConcat = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_aConcat.sqf";
  476. tfv_fnc_checkTrade = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_checkTrade.sqf";
  477. tfv_fnc_Convert = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_Convert.sqf";
  478. tfv_fnc_findPrices = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_findPrices.sqf";
  479. tfv_fnc_findTrWeapons = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_findTrWeapons.sqf";
  480. tfv_fnc_getSteps = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_getSteps.sqf";
  481. tfv_fnc_payTrade = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_payTrade.sqf";
  482. tfv_fnc_wCount = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_wCount.sqf";
  483. tfv_fnc_mCount = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_mCount.sqf";
  484. tfv_fnc_checkTradeMags = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_checkTradeMags.sqf";
  485. tfv_fnc_aConcatMags = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_aConcatMags.sqf";
  486. tfv_fnc_getStepsMags = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_getStepsMags.sqf";
  487. tfv_fnc_payTradem = compile preprocessFileLineNumbers "TradeFromVehicle\functions\fnc_payTradem.sqf";
  488.  
  489. /* ******************************************************************************************************************************************* */
  490. /* Init file finished. Start monitor script. */ [] ExecVM "TradeFromVehicle\monitor.sqf";
  491. /* ******************************************************************************************************************************************* */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement