Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DecorRegister('illegal_chargeMeth', 3)
- Citizen.CreateThread(function()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- end
- while ESX.GetPlayerData().job == nil do
- Citizen.Wait(10)
- end
- PlayerData = ESX.GetPlayerData()
- end)
- RegisterNetEvent('esx:setJob')
- AddEventHandler('esx:setJob', function(job)
- PlayerData.job = job
- end)
- -- Verifie si le joueurs est dans un vehicule ou pas
- function IsInVehicle()
- local ply = PlayerPedId()
- if IsPedSittingInAnyVehicle(ply) then
- return true
- else
- return false
- end
- end
- function recolte(currentVehicle, isGoodVehicle)
- if (PlayerData.job.name == 'police') then
- ESX.ShowNotification(_U('police_methylamine'))
- else
- if currentVehicle == 0 then
- ESX.ShowNotification(_U('need_vehicle'))
- return
- end
- if isGoodVehicle == false then
- ESX.ShowNotification(_U('bad_vehicle'))
- else
- if currentCharge >= 10000 then
- currentCharge = 10000
- ESX.ShowNotification(_U('full_vehicle'))
- Citizen.Wait(1000)
- ESX.ShowNotification(_U('full_vehicle_2'))
- Citizen.Wait(10000)
- ESX.ShowNotification(_U('full_vehicle_3'))
- else
- currentCharge = math.min(10000, currentCharge + 10)
- DecorSetInt(currentVehicle,'illegal_chargeMeth', currentCharge)
- ESX.ShowNotification(_U('filling_vehicle'))
- Citizen.Wait(100)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement