Advertisement
Guest User

Untitled

a guest
Jan 20th, 2018
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.35 KB | None | 0 0
  1. /*
  2. ##################### DYNAMIC MARKET SCRIPT #####################
  3. ### AUTHOR: RYAN TT. ###
  4. ### STEAM: www.steamcommunity.com/id/ryanthett ###
  5. ### ###
  6. ### DISCLAIMER: THIS SCRIPT CAN BE USED ON EVERY SERVER ONLY ###
  7. ### WITH THIS HEADER / NOTIFICATION ###
  8. #################################################################
  9. */
  10.  
  11. // ███████████████████████████████████████████████████████████████████████
  12. // █████████████████ DYNAMIC MARKET BASIC CONFIGURATION ██████████████████
  13. // ███████████████████████████████████████████████████████████████████████
  14.  
  15. DYNMARKET_Serveruptime = 1; // Serveruptime after restart in hours
  16. DYNMARKET_UseExternalDatabase = true; // Should the script use the External Database?
  17. DYNMARKET_PriceUpdateInterval = 1; // After how many minutes should the price be updated?
  18. DYNMARKET_CreateBackups = true; // Should the server save write the prices regulary into the Database? If false, it will save the prices before Server-restart?
  19. DYNMARKET_CreateBackupInterval = 1; // After how many updates (PriceUpdateIntervals) should the prices be saved into the Database?
  20. DYNMARKET_UserNotification = false; // Should the user be informed with a hint whenever the prices got updated?
  21.  
  22. // █████████████████ USER NOTIFICATION TEXTS █████████████████
  23.  
  24. DYNMARKET_UserNotification_Text =
  25. [
  26. "les prix sont mis a jour ! ",
  27. "Les nouveaux prix sont calculés par l'île ..."
  28. ];
  29.  
  30. // █████████████████ ITEM GROUP CONFIGURATION █████████████████
  31.  
  32. DYNMARKET_Items_Groups =
  33. [
  34. ["Legal",
  35. [
  36. ["oil_processed",-1,900,1750],
  37. ["copper_refined",-1,400,1200],
  38. ["iron_refined",-1,400,1200],
  39. ["salt_refined",-1,800,1600],
  40. ["glass",-1,800,1600],
  41. ["diamond_cut",-1,1500,2250],
  42. ["cement",-1,800,2220],
  43. ["popcorn",-1,150,400],
  44. ["pot_de_miel",-1,975,2500],
  45. ["lingot_argent",-1,1500,2250],
  46. ["sucre",-1,1000,2500],
  47. ["coffee",-1,2200,3800],
  48. ["cannabis_medic",-1,2800,4000],
  49. ["meuble",-1,3000,4200],
  50. ["chaussure",-1,2750,4300],
  51. ["pizza",-1,3300,5000],
  52. ["bouteille_de_vinasse",-1,3500,6500],
  53. ["mojito",-1,10000,25000]
  54.  
  55. ],
  56. 0.5
  57. ],
  58.  
  59. ["Illegal",
  60. [
  61. ["heroin_processed",1,5320,8640],
  62. ["marijuana",1,4590,7860],
  63. ["cocaine_processed",1,5320,8670],
  64. ["chaussure_de_contrebande",1,4000,8000],
  65. ["arme",1,6000,12000],
  66. ["bijou",1,7000,14000],
  67. ["sachet_de_champi",1,9000,18000],
  68. ["bouteille_absinthe",1,10000,25000],
  69. ["organe_masculin",1,25000,40000],
  70. ["organe_feminin",1,28000,43000],
  71. ["organe_enfant",1,35000,48000],
  72. ["goldbar",1,200000,255000]
  73. ],
  74. 0.5
  75. ]
  76. ];
  77.  
  78. //ALL SELLABLE ITEMS
  79.  
  80. DYNMARKET_Items_ToTrack =
  81. [
  82. ["popcorn",250],
  83. ["copper_refined",400],
  84. ["iron_refined",400],
  85. ["salt_refined",800],
  86. ["glass",800],
  87. ["cement",800],
  88. ["oil_processed",900],
  89. ["diamond_cut",1500],
  90. ["pot_de_miel",975],
  91. ["lingot_argent",1500],
  92. ["sucre",1000],
  93. ["coffee",2200],
  94. ["cannabis_medic",2800],
  95. ["meuble",3000],
  96. ["marijuana",4590],
  97. ["chaussure",2750],
  98. ["heroin_processed",5320],
  99. ["cocaine_processed",5320],
  100. ["pizza",3300],
  101. ["bouteille_de_vinasse",3500],
  102. ["chaussure_de_contrebande",4000],
  103. ["arme",6000],
  104. ["bijou",7000],
  105. ["sachet_de_champi",9000],
  106. ["bouteille_absinthe",10000],
  107. ["mojito",10000],
  108. ["organe_masculin",25000],
  109. ["organe_feminin",28000],
  110. ["organe_enfant",35000],
  111. ["goldBar",200000]
  112. ];
  113.  
  114. //███████████████████████████████████████████████████████████████████████
  115. //██████████████████ DO NOT MODIFY THE FOLLOWING CODE! ██████████████████
  116. //███████████████████████████████████████████████████████████████████████
  117.  
  118. DYNMARKET_Items_CurrentPriceArr = [];
  119. DYNMARKET_sellarraycopy = DYNMARKET_Items_ToTrack;
  120. DYNMARKET_Serveruptime = (DYNMARKET_Serveruptime * 3600) - 300;
  121. {
  122. _currentArray = _x;
  123. DYNMARKET_Items_CurrentPriceArr pushBack [_currentArray select 0,_currentArray select 1,0];
  124. } forEach DYNMARKET_Items_ToTrack;
  125. publicVariable "DYNMARKET_UserNotification";
  126. publicVariable "DYNMARKET_UserNotification_Text";
  127. if (DYNMARKET_UseExternalDatabase) then {[1] call TON_fnc_HandleDB;};
  128. DYNMARKET_UpdateCount = 0;
  129. if (DYNMARKET_UseExternalDatabase) then {
  130. [] spawn {
  131. sleep DYNMARKET_Serveruptime;
  132. diag_log "### DYNMARKET >> CURRENT PRICES ARE BEING WRITTEN TO THE DATABASE ###";
  133. diag_log "### DYNMARKET >> AS PLANNED, AWAITING RESULT... ###";
  134. [0] call TON_fnc_HandleDB;
  135. };
  136. };
  137. sleep 5;
  138. [] call TON_fnc_sleeper;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement