fork download
  1. ESX = nil
  2. local PlayerData = {}
  3. local GUI = {}
  4. GUI.Time = 0
  5. local HasAlreadyEnteredMarker = false
  6. local LastZone = nil
  7. local CurrentAction = nil
  8. local CurrentActionMsg = ''
  9. local CurrentActionData = {}
  10. local OnJob = false
  11. local TargetCoords = nil
  12.  
  13. Citizen.CreateThread(function()
  14. while ESX == nil do
  15. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  16. Citizen.Wait(0)
  17. end
  18. end)
  19.  
  20. function OpenLumberBossMenu()
  21. if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name ~= 'boss' then
  22.  
  23. local elements = {
  24. {label = 'Sortir Véhicule', value = 'vehicle_list'},
  25. {label = 'Tenue de travail', value = 'cloakroom'},
  26. {label = 'Tenue civile', value = 'cloakroom2'}
  27. }
  28. if Config.EnablePlayerManagement and PlayerData.job ~= nil and PlayerData.job.grade_name == 'boss' then
  29. table.insert(elements, {label = 'Retirer argent société', value = 'withdraw_society_money'})
  30. table.insert(elements, {label = 'Déposer argent ', value = 'deposit_money'})
  31. table.insert(elements, {label = 'Blanchir argent', value = 'wash_money'})
  32. end
  33.  
  34. ESX.UI.Menu.CloseAll()
  35.  
  36. ESX.UI.Menu.Open(
  37. 'default', GetCurrentResourceName(), 'mecano_actions',
  38. {
  39. title = 'Mecano',
  40. elements = elements
  41. },
  42. function(data, menu)
  43.  
  44.  
  45.  
  46.  
  47. if data.current.value == 'withdraw_society_money' then
  48. ESX.UI.Menu.Open(
  49. 'dialog', GetCurrentResourceName(), 'withdraw_society_money_amount',
  50. {
  51. title = 'Montant du retrait'
  52. },
  53. function(data, menu)
  54. local amount = tonumber(data.value)
  55. if amount == nil then
  56. ESX.ShowNotification('Montant invalide')
  57. else
  58. menu.close()
  59. TriggerServerEvent('esx_society:withdrawMoney', 'mecano', amount)
  60. end
  61. end,
  62. function(data, menu)
  63. menu.close()
  64. end
  65. )
  66. end
  67.  
  68. if data.current.value == 'deposit_money' then
  69. ESX.UI.Menu.Open(
  70. 'dialog', GetCurrentResourceName(), 'deposit_money_amount',
  71. {
  72. title = 'Montant du dépôt'
  73. },
  74. function(data, menu)
  75. local amount = tonumber(data.value)
  76. if amount == nil then
  77. ESX.ShowNotification('Montant invalide')
  78. else
  79. menu.close()
  80. TriggerServerEvent('esx_society:depositMoney', 'mecano', amount)
  81. end
  82. end,
  83. function(data, menu)
  84. menu.close()
  85. end
  86. )
  87. end
  88.  
  89. if data.current.value == 'wash_money' then
  90. ESX.UI.Menu.Open(
  91. 'dialog', GetCurrentResourceName(), 'wash_money_amount',
  92. {
  93. title = 'Montant à blanchir'
  94. },
  95. function(data, menu)
  96. local amount = tonumber(data.value)
  97. if amount == nil then
  98. ESX.ShowNotification('Montant invalide')
  99. else
  100. menu.close()
  101. TriggerServerEvent('esx_society:washMoney', 'mecano', amount)
  102. end
  103. end,
  104. function(data, menu)
  105. menu.close()
  106. end
  107. )
  108. end
  109. end,
  110. function(data, menu)
  111. menu.close()
  112. CurrentAction = 'lumber_boss_menu'
  113. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu.'
  114. CurrentActionData = {}
  115. end
  116. )
  117. end
  118.  
  119. function OpenLumberVehicleMenu()
  120.  
  121. local elements = {
  122. {label = 'Camion Phantom', value = 'phantom', trailer = 'trailers'}
  123. }
  124.  
  125. if Config.EnablePlayerManagement and PlayerData.job ~= nil and
  126. (PlayerData.job.grade_name == 'boss' or PlayerData.job.grade_name == 'employee' or PlayerData.job.grade_name == 'responsable') then
  127. table.insert(elements, {label = 'Camion Packer', value = 'packer', trailer = 'trailers'})
  128. end
  129.  
  130. if Config.EnablePlayerManagement and PlayerData.job ~= nil and
  131. (PlayerData.job.grade_name == 'boss' or PlayerData.job.grade_name == 'responsable') then
  132. table.insert(elements, {label = 'Camion Fast Phantom', value = 'phantom3', trailer = 'trailers'})
  133. end
  134.  
  135. if Config.EnablePlayerManagement and PlayerData.job ~= nil and
  136. (PlayerData.job.grade_name == 'boss') then
  137. table.insert(elements, {label = 'Pickup Bison', value = 'bison3', trailer = 'none'})
  138. end
  139.  
  140. ESX.UI.Menu.CloseAll()
  141.  
  142. ESX.UI.Menu.Open(
  143. 'default', GetCurrentResourceName(), 'spawn_vehicle',
  144. {
  145. title = 'Véhicule de service',
  146. elements = elements
  147. },
  148. function(data, menu)
  149. for i=1, #elements, 1 do
  150. if Config.MaxInService == -1 then
  151. local playerPed = GetPlayerPed(-1)
  152. local coords = Config.Zones.VehicleSpawnPoint.Pos
  153. ESX.Game.SpawnVehicle(data.current.value, coords, 90.0, function(vehicle)
  154. if data.current.trailer ~= "none" then
  155. ESX.Game.SpawnVehicle(data.current.rem, coords, 90.0, function(trailer)
  156. AttachVehicleToTrailer(vehicle, trailer, 1.1)
  157. end)
  158. end
  159. TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
  160. end)
  161. break
  162. else
  163. ESX.TriggerServerCallback('esx_service:enableService', function(canTakeService, maxInService, inServiceCount)
  164. if canTakeService then
  165. local playerPed = GetPlayerPed(-1)
  166. local coords = Config.Zones.VehicleSpawnPoint.Pos
  167. ESX.Game.SpawnVehicle(data.current.value, coords, 90.0, function(vehicle)
  168. if data.current.trailer ~= "none" then
  169. ESX.Game.SpawnVehicle(data.current.rem, coords, 90.0, function(trailer)
  170. AttachVehicleToTrailer(vehicle, trailer, 1.1)
  171. end)
  172. end
  173. TaskWarpPedIntoVehicle(playerPed, vehicle, -1)
  174. end)
  175. else
  176. ESX.ShowNotification('Service complet : ' .. inServiceCount .. '/' .. maxInService)
  177. end
  178. end, 'lumberjack')
  179. break
  180. end
  181. end
  182. menu.close()
  183.  
  184. end,
  185. function(data, menu)
  186. menu.close()
  187. CurrentAction = 'spawn_vehicle_menu'
  188. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au Garage.'
  189. CurrentActionData = {}
  190. end
  191. )
  192. end
  193.  
  194. function OpenLumberCloakroomtMenu()
  195.  
  196. local elements = {
  197. {label = 'Tenue de travail', value = 'cloakroom'},
  198. {label = 'Tenue civile', value = 'cloakroom2'}
  199. }
  200.  
  201. ESX.UI.Menu.CloseAll()
  202.  
  203. ESX.UI.Menu.Open(
  204. 'default', GetCurrentResourceName(), 'lumber_cloakroom',
  205. {
  206. title = 'Etabli',
  207. elements = elements
  208. },
  209. function(data, menu)
  210.  
  211. if data.current.value == 'cloakroom' then
  212. menu.close()
  213. ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
  214.  
  215. if skin.sex == 0 then
  216. TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_male)
  217. else
  218. TriggerEvent('skinchanger:loadClothes', skin, jobSkin.skin_female)
  219. end
  220.  
  221. end)
  222. end
  223.  
  224. if data.current.value == 'cloakroom2' then
  225. menu.close()
  226. ESX.TriggerServerCallback('esx_skin:getPlayerSkin', function(skin, jobSkin)
  227. TriggerEvent('skinchanger:loadSkin', skin)
  228.  
  229. end)
  230. end
  231.  
  232. end,
  233. function(data, menu)
  234. menu.close()
  235. CurrentAction = 'lumber_cloakroom_menu'
  236. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au véstiaire.'
  237. CurrentActionData = {}
  238. end
  239. )
  240. end
  241.  
  242. function OpenMobileLumberActionsMenu()
  243.  
  244. ESX.UI.Menu.CloseAll()
  245.  
  246. ESX.UI.Menu.Open(
  247. 'default', GetCurrentResourceName(), 'mobile_lumber_actions',
  248. {
  249. title = 'Mécano',
  250. elements = {
  251. {label = 'Facuration', value = 'billing'}
  252. }
  253. },
  254. function(data, menu)
  255. if data.current.value == 'billing' then
  256. ESX.UI.Menu.Open(
  257. 'dialog', GetCurrentResourceName(), 'billing',
  258. {
  259. title = 'Montant de la facture'
  260. },
  261. function(data, menu)
  262. local amount = tonumber(data.value)
  263. if amount == nil then
  264. ESX.ShowNotification('Montant invalide')
  265. else
  266. menu.close()
  267. local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer()
  268. if closestPlayer == -1 or closestDistance > 3.0 then
  269. ESX.ShowNotification('Aucun joueur à proximité')
  270. else
  271. TriggerServerEvent('esx_billing:sendBill', GetPlayerServerId(closestPlayer), 'society_lumberjack', 'Bucheron', amount)
  272. end
  273. end
  274. end,
  275. function(data, menu)
  276. menu.close()
  277. end
  278. )
  279. end
  280.  
  281. end,
  282. function(data, menu)
  283. menu.close()
  284. end
  285. )
  286. end
  287.  
  288. RegisterNetEvent('esx:playerLoaded')
  289. AddEventHandler('esx:playerLoaded', function(xPlayer)
  290. PlayerData = xPlayer
  291. end)
  292.  
  293. RegisterNetEvent('esx:setJob')
  294. AddEventHandler('esx:setJob', function(job)
  295. PlayerData.job = job
  296. end)
  297.  
  298. AddEventHandler('esx_lumberjackjob:hasEnteredMarker', function(zone)
  299. if zone == 'Bossroom' then
  300. CurrentAction = 'lumber_boss_menu'
  301. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au menu Patron.'
  302. CurrentActionData = {}
  303. end
  304. if zone == 'Cloakroom' then
  305. CurrentAction = 'lumber_cloakroom_menu'
  306. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au véstiaire.'
  307. CurrentActionData = {}
  308. end
  309. if zone == 'Wood' then
  310. CurrentAction = 'harvest_wood'
  311. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour récolter du bois.'
  312. CurrentActionData = {}
  313. end
  314. if zone == 'CuttedWood' then
  315. CurrentAction = 'transform_cuttedwood'
  316. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour couper du bois.'
  317. CurrentActionData = {}
  318. end
  319. if zone == 'Planks' then
  320. CurrentAction = 'harvest_plank'
  321. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour récupérer des planches.'
  322. CurrentActionData = {}
  323. end
  324. if zone == 'Delivery' then
  325. CurrentAction = 'resell'
  326. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour vendre des planches.'
  327. CurrentActionData = {}
  328. end
  329. if zone == 'VehicleSpawner' then
  330. CurrentAction = 'spawn_vehicle_menu'
  331. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour accéder au garage.'
  332. CurrentActionData = {}
  333. end
  334. if zone == 'VehicleDeleter' then
  335. local playerPed = GetPlayerPed(-1)
  336. if IsPedInAnyVehicle(playerPed, false) then
  337. CurrentAction = 'delete_vehicle'
  338. CurrentActionMsg = 'Appuyez sur ~INPUT_CONTEXT~ pour ranger le véhicule.'
  339. CurrentActionData = {}
  340. end
  341. end
  342. end)
  343.  
  344. AddEventHandler('esx_lumberjackjob:hasExitedMarker', function(zone)
  345.  
  346. if zone == 'Wood' then
  347. TriggerServerEvent('esx_lumberjackjob:stopHarvestWood')
  348. end
  349.  
  350. if zone == 'CuttedWood' then
  351. TriggerServerEvent('esx_lumberjackjob:stopCutingWood')
  352. end
  353.  
  354. if zone == 'Planks' then
  355. TriggerServerEvent('esx_lumberjackjob:stopPackagePlank')
  356. end
  357.  
  358. if zone == 'Delivery' then
  359. TriggerServerEvent('esx_lumberjackjob:stopResell')
  360. end
  361.  
  362. CurrentAction = nil
  363. ESX.UI.Menu.CloseAll()
  364. end)
  365.  
  366. RegisterNetEvent('esx_phone:loaded')
  367. AddEventHandler('esx_phone:loaded', function(phoneNumber, contacts)
  368. local specialContact = {
  369. name = 'Bucheron',
  370. number = 'bucheron',
  371. base64Icon = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH4QgKFDokTIT4JgAABsVJREFUWMPtl1tsXFcVhr+9zzlzzpkZe+zxtbFjx7GJ49wTSJqQhjSNGgJIqFVVCVRARYJIFEQE6hMqDyDBE29QKU8ICSSEVEVcBFIqlbQqKSQ0JGmc2Lm18SVx7BnbY3tmzn1vHjJJ3aqOTcoLEr+0X/ZaZ61/r7PXWnvB8pAfsS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}
  373. TriggerEvent('esx_phone:addSpecialContact', specialContact.name, specialContact.number, specialContact.base64Icon)
  374. end)
  375.  
  376. -- Create Blips
  377. Citizen.CreateThread(function()
  378. local blip = AddBlipForCoord(Config.Zones.Cloakroom.Pos.x, Config.Zones.Cloakroom.Pos.y, Config.Zones.Cloakroom.Pos.z)
  379. SetBlipSprite (blip, 237)
  380. SetBlipDisplay(blip, 4)
  381. SetBlipScale (blip, 1.0)
  382. SetBlipColour (blip, 5)
  383. SetBlipAsShortRange(blip, true)
  384. BeginTextCommandSetBlipName("STRING")
  385. AddTextComponentString("Dépôt Bucheron")
  386. EndTextCommandSetBlipName(blip)
  387. end)
  388.  
  389. Citizen.CreateThread(function()
  390. local blip = AddBlipForCoord(Config.Zones.Wood.Pos.x, Config.Zones.Wood.Pos.y, Config.Zones.Wood.Pos.z)
  391. SetBlipSprite (blip, 237)
  392. SetBlipDisplay(blip, 4)
  393. SetBlipScale (blip, 1.0)
  394. SetBlipColour (blip, 5)
  395. SetBlipAsShortRange(blip, true)
  396. BeginTextCommandSetBlipName("STRING")
  397. AddTextComponentString("Scierie")
  398. EndTextCommandSetBlipName(blip)
  399. end)
  400.  
  401. -- Display markers
  402. Citizen.CreateThread(function()
  403. while true do
  404. Wait(0)
  405. if PlayerData.job ~= nil and PlayerData.job.name == 'lumberjack' then
  406.  
  407. local coords = GetEntityCoords(GetPlayerPed(-1))
  408.  
  409. for k,v in pairs(Config.Zones) do
  410. if(v.Type ~= -1 and GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < Config.DrawDistance) then
  411. DrawMarker(v.Type, v.Pos.x, v.Pos.y, v.Pos.z, 0.0, 0.0, 0.0, 0, 0.0, 0.0, v.Size.x, v.Size.y, v.Size.z, v.Color.r, v.Color.g, v.Color.b, 100, false, true, 2, false, false, false, false)
  412. end
  413. end
  414. end
  415. end
  416. end)
  417.  
  418. -- Enter / Exit marker events
  419. Citizen.CreateThread(function()
  420. while true do
  421. Wait(0)
  422. if PlayerData.job ~= nil and PlayerData.job.name == 'lumberjack' then
  423. local coords = GetEntityCoords(GetPlayerPed(-1))
  424. local isInMarker = false
  425. local currentZone = nil
  426. for k,v in pairs(Config.Zones) do
  427. if(GetDistanceBetweenCoords(coords, v.Pos.x, v.Pos.y, v.Pos.z, true) < v.Size.x) then
  428. isInMarker = true
  429. currentZone = k
  430. end
  431. end
  432. if (isInMarker and not HasAlreadyEnteredMarker) or (isInMarker and LastZone ~= currentZone) then
  433. HasAlreadyEnteredMarker = true
  434. LastZone = currentZone
  435. TriggerEvent('esx_lumberjackjob:hasEnteredMarker', currentZone)
  436. end
  437. if not isInMarker and HasAlreadyEnteredMarker then
  438. HasAlreadyEnteredMarker = false
  439. TriggerEvent('esx_lumberjackjob:hasExitedMarker', LastZone)
  440. end
  441. end
  442. end
  443. end)
  444.  
  445. -- Key Controls
  446. Citizen.CreateThread(function()
  447. while true do
  448. Citizen.Wait(0)
  449. if CurrentAction ~= nil then
  450. SetTextComponentFormat('STRING')
  451. AddTextComponentString(CurrentActionMsg)
  452. DisplayHelpTextFromStringLabel(0, 0, 1, -1)
  453. if IsControlJustReleased(0, 38) and PlayerData.job ~= nil and PlayerData.job.name == 'lumberjack' then
  454. if CurrentAction == 'lumber_boss_menu' then
  455. OpenLumberBossMenu()
  456. end
  457. if CurrentAction == 'lumber_cloakroom_menu' then
  458. OpenLumberCloakroomtMenu()
  459. end
  460. if CurrentAction == 'spawn_vehicle_menu' then
  461. OpenLumberVehicleMenu()
  462. end
  463. if CurrentAction == 'harvest_wood' then
  464. TriggerServerEvent('esx_lumberjackjob:startHarvestWood')
  465. end
  466. if CurrentAction == 'transform_cuttedwood' then
  467. TriggerServerEvent('esx_lumberjackjob:startCutingWood')
  468. end
  469. if CurrentAction == 'harvest_plank' then
  470. TriggerServerEvent('esx_lumberjackjob:startPackagePlank')
  471. end
  472. if CurrentAction == 'resell' then
  473. TriggerServerEvent('esx_lumberjackjob:startResell')
  474. end
  475. if CurrentAction == 'delete_vehicle' then
  476. local playerPed = GetPlayerPed(-1)
  477. local vehicle = GetVehiclePedIsIn(playerPed, false)
  478. local hash = GetEntityModel(vehicle)
  479. if hash == GetHashKey('phantom') or hash == GetHashKey('packer') or hash == GetHashKey('phantom3') or hash == GetHashKey('bison3') then
  480. if Config.MaxInService ~= -1 then
  481. TriggerServerEvent('esx_service:disableService', 'lumberjack')
  482. end
  483. DeleteVehicle(vehicle)
  484. else
  485. ESX.ShowNotification('Vous ne pouvez ranger que des ~b~véhicules de Bucheron~s~.')
  486. end
  487. end
  488. CurrentAction = nil
  489. end
  490. end
  491.  
  492. if IsControlJustReleased(0, 167) and PlayerData.job ~= nil and PlayerData.job.name == 'lumberjack' then
  493. OpenMobileLumberActionsMenu()
  494. end
  495. end
  496. end)
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
luac5.3: prog.lua:496: 'end' expected (to close 'function' at line 20) near <eof>
stdout
Standard output is empty