Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lockState = {}
- ESX = nil
- Citizen.CreateThread(function()
- while ESX == nil do
- TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
- Citizen.Wait(0)
- end
- end)
- RegisterNetEvent('esx:playerLoaded')
- AddEventHandler('esx:playerLoaded', function(xPlayer)
- PlayerData = xPlayer
- end)
- RegisterNetEvent('esx:setJob')
- AddEventHandler('esx:setJob', function(job)
- PlayerData.job = job
- end)
- RegisterServerEvent('OD:updateState')
- AddEventHandler('OD:updateState', function(doorID, state)
- end)
- function IsJobTrue()
- if PlayerData.job ~= nil then
- local IsJobTrue = false
- if PlayerData.job ~=nil and PlayerData.job == 'cartel' then
- IsJobTrue = true
- end
- if IsJobTrue == nil then
- local canuse = false
- if IsJobTrue ~= true then
- local canuse = true
- end
- end
- end
- if canuse then
- lockState[doorID] = {}
- lockState[doorID].state = state
- lockState[doorID].doorID = doorID
- TriggerClientEvent('OD:state', -1, doorID, state)
- end
- end
Add Comment
Please, Sign In to add comment