Advertisement
RISKSCRIPTS

Farmingsystem Config

Nov 4th, 2024
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 12.15 KB | Source Code | 0 0
  1. RS = {}
  2.  
  3. -- Function to display notifications
  4. RS.notify = function(msg)
  5. SetNotificationTextEntry("STRING")
  6. AddTextComponentSubstringPlayerName(msg)
  7. DrawNotification(false, true)
  8. end
  9.  
  10. -- Function to display help text
  11. RS.DisplayHelpText = function(str)
  12. BeginTextCommandDisplayHelp("STRING")
  13. AddTextComponentSubstringPlayerName(str)
  14. EndTextCommandDisplayHelp(0, false, true, -1)
  15. end
  16.  
  17. -- Set the language (options: 'de', 'en', add more)
  18. RS.Language = 'de'
  19.  
  20. -- Set the framework (options: 'auto', 'esx', 'qbcore')
  21. RS.Framework = "auto"
  22.  
  23. -- Localization function
  24. function _U(msgKey, ...)
  25. local lang = RS.Language
  26. local message = Locales[lang][msgKey] or Locales['en'][msgKey]
  27. return string.format(message, ...)
  28. end
  29.  
  30. -- Marker configuration
  31. RS.marker = {
  32. ['enabled'] = true,
  33. ['bobUpAndDown'] = true,
  34. ['faceCamera'] = true,
  35. ['rotate'] = false,
  36. ['drawDistance'] = 50,
  37. ['type'] = 21,
  38. ['color'] = {
  39. ['r'] = 0,
  40. ['g'] = 182,
  41. ['b'] = 242,
  42. ['a'] = 150
  43. },
  44. ['scale'] = {
  45. ['x'] = 1.0,
  46. ['y'] = 1.0,
  47. ['z'] = 1.0
  48. }
  49. }
  50.  
  51. -- Processor configuration
  52. RS.processor = {
  53. {
  54. ['name'] = 'Kiesel',
  55. ['location'] = vector3(1211.1456, 1857.8119, 78.9115),
  56. ['helptext'] = 'Drücke E um Kiesel zu verarbeiten', -- "Press E to process Kiesel"
  57. ['blip'] = {
  58. ['name'] = 'Kiesel Verarbeiter', -- "Kiesel Processor"
  59. ['sprite'] = 365,
  60. ['display'] = 4,
  61. ['scale'] = 1.0,
  62. ['color'] = 2,
  63. ['shortrange'] = true
  64. },
  65. ['showblip'] = true, -- Set to false to hide the blip even if the player has access
  66. ['required'] = {
  67. ['name'] = 'kiesel',
  68. ['label'] = 'Kiesel',
  69. ['amount'] = 10
  70. },
  71. ['receive'] = {
  72. ['name'] = 'sand',
  73. ['label'] = 'Sand',
  74. ['amount'] = 1
  75. },
  76. ['processing_time'] = 20, -- in seconds
  77. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  78. },
  79. {
  80. ['name'] = 'Wassermelone | Boost',
  81. ['location'] = vector3(414.8102, -2052.6086, 22.1964),
  82. ['helptext'] = 'Drücke E um Wassermelone zu schneiden', -- "Press E to cut watermelon"
  83. ['blip'] = {
  84. ['name'] = 'Wassermelone Schneiden | Boost', -- "Watermelon Cutting | Boost"
  85. ['sprite'] = 365,
  86. ['display'] = 4,
  87. ['scale'] = 1.0,
  88. ['color'] = 48,
  89. ['shortrange'] = true
  90. },
  91. ['showblip'] = true, -- Blip will be shown
  92. ['required'] = {
  93. ['name'] = 'wassermelone',
  94. ['label'] = 'Wassermelone',
  95. ['amount'] = 1
  96. },
  97. ['receive'] = {
  98. ['name'] = 'gwassermelone',
  99. ['label'] = 'Geschnittene Wassermelone', -- "Sliced Watermelon"
  100. ['amount'] = 4
  101. },
  102. ['processing_time'] = 60, -- in seconds
  103. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  104. },
  105. {
  106. ['name'] = 'Eis Wassermelone | Boost',
  107. ['location'] = vector3(867.2131, -1640.2905, 30.1913),
  108. ['helptext'] = 'Drücke E um Wassermelone einzufrieren', -- "Press E to freeze watermelon"
  109. ['blip'] = {
  110. ['name'] = 'Wassermelone Einfrieren | Boost', -- "Watermelon Freezing | Boost"
  111. ['sprite'] = 365,
  112. ['display'] = 4,
  113. ['scale'] = 1.0,
  114. ['color'] = 48,
  115. ['shortrange'] = true
  116. },
  117. ['showblip'] = true, -- Blip will be shown
  118. ['required'] = {
  119. ['name'] = 'gwassermelone',
  120. ['label'] = 'Geschnittene Wassermelone', -- "Sliced Watermelon"
  121. ['amount'] = 4
  122. },
  123. ['receive'] = {
  124. ['name'] = 'eiswassermelone',
  125. ['label'] = 'Wassermelonen Eis', -- "Watermelon Ice"
  126. ['amount'] = 4
  127. },
  128. ['processing_time'] = 3, -- in seconds
  129. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  130. },
  131. {
  132. ['name'] = 'Erdbeeren',
  133. ['location'] = vector3(1792.1180, 4593.0049, 37.6825),
  134. ['helptext'] = 'Drücke E um deine Erdbeeren zu verarbeiten', -- "Press E to process your strawberries"
  135. ['blip'] = {
  136. ['name'] = 'Erdbeeren Verarbeiter', -- "Strawberry Processor"
  137. ['sprite'] = 365,
  138. ['display'] = 4,
  139. ['scale'] = 1.0,
  140. ['color'] = 48,
  141. ['shortrange'] = true
  142. },
  143. ['showblip'] = true, -- Blip will be shown
  144. ['required'] = {
  145. ['name'] = 'erdbeeren',
  146. ['label'] = 'Erdbeeren', -- "Strawberries"
  147. ['amount'] = 4
  148. },
  149. ['receive'] = {
  150. ['name'] = 'erdbeerensm',
  151. ['label'] = 'Erdbeer Smoothie', -- "Strawberry Smoothie"
  152. ['amount'] = 1
  153. },
  154. ['processing_time'] = 25, -- in seconds
  155. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  156. }
  157. }
  158.  
  159. -- Seller configuration
  160. RS.seller = {
  161. {
  162. ['name'] = 'Sand',
  163. ['location'] = vector3(1708.4001, -1610.4089, 113.814),
  164. ['helptext'] = 'Drücke E um deinen Sand zu verkaufen', -- "Press E to sell your sand"
  165. ['blip'] = {
  166. ['name'] = 'Sand Käufer', -- "Sand Buyer"
  167. ['sprite'] = 365,
  168. ['display'] = 4,
  169. ['scale'] = 1.0,
  170. ['color'] = 2,
  171. ['shortrange'] = true
  172. },
  173. ['showblip'] = true, -- Blip will be shown
  174. ['item'] = {
  175. ['name'] = 'sand',
  176. ['label'] = 'Sand',
  177. ['plural'] = 'Sand',
  178. ['min_price'] = 150,
  179. ['max_price'] = 250
  180. },
  181. ['sell_time'] = 10, -- in seconds
  182. ['payment_type'] = 'black_money', -- Options: 'cash', 'black_money', 'bank'
  183. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  184. },
  185. {
  186. ['name'] = 'Wassermelone Eis | Boost',
  187. ['location'] = vector3(-1149.3453, -1602.1035, 4.3901),
  188. ['helptext'] = 'Drücke E um dein Eis zu verkaufen', -- "Press E to sell your ice cream"
  189. ['blip'] = {
  190. ['name'] = 'Eis Käufer | Boost', -- "Ice Cream Buyer | Boost"
  191. ['sprite'] = 365,
  192. ['display'] = 4,
  193. ['scale'] = 1.0,
  194. ['color'] = 48,
  195. ['shortrange'] = true
  196. },
  197. ['showblip'] = true, -- Blip will not be shown
  198. ['item'] = {
  199. ['name'] = 'eiswassermelone',
  200. ['label'] = 'Wassermelonen Eis', -- "Watermelon Ice Cream"
  201. ['plural'] = 'Wassermelonen Eis',
  202. ['min_price'] = 150,
  203. ['max_price'] = 250
  204. },
  205. ['sell_time'] = 15, -- in seconds
  206. ['payment_type'] = 'cash', -- Options: 'cash', 'black_money', 'bank'
  207. ['allowed_jobs'] = {'police'} -- Only players with the 'police' job can access
  208. },
  209. {
  210. ['name'] = 'Erdbeer Smoothie',
  211. ['location'] = vector3(1263.5089, 3545.2148, 35.1600),
  212. ['helptext'] = 'Drücke E um deinen Erdbeer Smoothie zu verkaufen', -- "Press E to sell your strawberry smoothie"
  213. ['blip'] = {
  214. ['name'] = 'Smoothie Käufer', -- "Smoothie Buyer"
  215. ['sprite'] = 365,
  216. ['display'] = 4,
  217. ['scale'] = 1.0,
  218. ['color'] = 48,
  219. ['shortrange'] = true
  220. },
  221. ['showblip'] = true, -- Blip will be shown
  222. ['item'] = {
  223. ['name'] = 'erdbeerensm',
  224. ['label'] = 'Erdbeer Smoothie', -- "Strawberry Smoothie"
  225. ['plural'] = 'Erdbeer Smoothies',
  226. ['min_price'] = 150,
  227. ['max_price'] = 250
  228. },
  229. ['sell_time'] = 8, -- in seconds
  230. ['payment_type'] = 'cash', -- Options: 'cash', 'black_money', 'bank'
  231. ['allowed_jobs'] = {} -- Empty table means everyone can access
  232. }
  233. }
  234.  
  235. -- Localization strings
  236. Locales = {
  237. ['de'] = {
  238. ['process_success'] = 'Du hast erfolgreich %sx %s verarbeitet.',
  239. ['process_fail'] = 'Fehler - Bitte versuche es erneut.',
  240. ['sell_success'] = 'Du hast %sx %s verkauft und dafür %s$ erhalten.',
  241. ['sell_fail'] = 'Fehler - Bitte versuche es erneut.',
  242. ['farm_start'] = 'Du hast angefangen, folgende Items zu farmen: %s.',
  243. ['farm_afk'] = 'AFK-Farming aktiviert: Du erhältst folgende Items alle %s Sekunden: %s.',
  244. ['farm_fail'] = 'Fehler - Du hast das Item nicht erhalten.',
  245. ['farm_afk_disabled'] = 'AFK-Farming deaktiviert: Du musst E drücken, um zu farmen.',
  246. ['farm_collect'] = 'Du hast folgende Items erhalten: %s.',
  247. ['farm_press_e'] = 'Drücke E, um erneut zu farmen.',
  248. ['farm_cancelled'] = 'Farmen abgebrochen.',
  249. ['need_car'] = 'Du benötigst ein Fahrzeug.',
  250. ['progressbar_farming'] = 'Farmen...',
  251. ['progressbar_afk_farming'] = 'AFK-Farmen...',
  252. ['tool_required'] = 'Du benötigst ein %s, um zu farmen.',
  253. ['event_bonus_item'] = 'Du hast ein Bonus-Item gefunden!',
  254. ['already_farming'] = 'Du farmst bereits.',
  255. ['need_tool'] = 'Du benötigst ein %s, um zu farmen.',
  256. ['interact_with_prop'] = 'Drücke ~INPUT_CONTEXT~ zum Farmen.',
  257. ['farming_started'] = 'Angefangen zu farmen.',
  258. ['farming_completed'] = 'Aufgehört zu farmen.',
  259. ['farming_failed'] = 'Farming fehlgeschlagen.',
  260. ['prop_respawn'] = 'Der Baum wird in %s Sekunden neu gespawnt.',
  261. ['received_item'] = 'Du hast %sx %s erhalten.',
  262. ['inventory_full'] = 'Dein Inventar ist voll.',
  263. ['no_access'] = 'Du hast keinen Zugriff auf diese Aktion.',
  264. },
  265. ['en'] = {
  266. ['process_success'] = 'You have successfully processed %sx %s.',
  267. ['process_fail'] = 'Error - Please try again.',
  268. ['sell_success'] = 'You have sold %sx %s and received %s$.',
  269. ['sell_fail'] = 'Error - Please try again.',
  270. ['farm_start'] = 'You have started farming the following items: %s.',
  271. ['farm_afk'] = 'AFK farming enabled: You will receive the following items every %s seconds: %s.',
  272. ['farm_fail'] = 'Error - You did not receive the item.',
  273. ['farm_afk_disabled'] = 'AFK farming disabled: You must press E to farm.',
  274. ['farm_collect'] = 'You have received the following items: %s.',
  275. ['farm_press_e'] = 'Press E to farm again.',
  276. ['farm_cancelled'] = 'Farming cancelled.',
  277. ['need_car'] = 'You need a vehicle to farm.',
  278. ['progressbar_farming'] = 'Farming...',
  279. ['progressbar_afk_farming'] = 'AFK Farming...',
  280. ['tool_required'] = 'You need a %s to farm.',
  281. ['event_bonus_item'] = 'You found a bonus item!',
  282. ['already_farming'] = 'You are already farming.',
  283. ['need_tool'] = 'You need a %s to farm.',
  284. ['interact_with_prop'] = 'Press ~INPUT_CONTEXT~ to farm.',
  285. ['farming_started'] = 'Started farming.',
  286. ['farming_completed'] = 'Stopped farming.',
  287. ['farming_failed'] = 'Farming failed.',
  288. ['prop_respawn'] = 'The tree will respawn in %s seconds.',
  289. ['received_item'] = 'You have received %sx %s.',
  290. ['inventory_full'] = 'Your inventory is full.',
  291. ['no_access'] = 'You do not have access to this action.',
  292. },
  293. }
  294.  
  295. -- Custom progress bar configuration
  296. RS.UseCustomProgressBar = false
  297.  
  298. RS.CustomProgressBar = {
  299. PushProgressbar = function(msg, time)
  300. exports["rs_notifypack_v2"]:PushProgressbar(msg, time)
  301. end,
  302. CancelProgressbar = function()
  303. exports["rs_notifypack_v2"]:CancelProgressbar()
  304. end
  305. }
  306.  
  307. -- Function to detect the framework
  308. function DetectFramework()
  309. if RS.Framework == "auto" then
  310. if GetResourceState('es_extended') == 'started' then
  311. return 'esx'
  312. elseif GetResourceState('qb-core') == 'started' then
  313. return 'qbcore'
  314. else
  315. print("No Framework detected!")
  316. return nil
  317. end
  318. else
  319. return RS.Framework
  320. end
  321. end
  322.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement