Guest User

Untitled

a guest
Nov 19th, 2018
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.15 KB | None | 0 0
  1. lockState = {}
  2.  
  3. ESX                             = nil
  4.  
  5.  
  6. Citizen.CreateThread(function()
  7.   while ESX == nil do
  8.          TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  9.          Citizen.Wait(0)
  10.     end
  11.    
  12. end)
  13.  
  14.  
  15. RegisterNetEvent('esx:playerLoaded')
  16. AddEventHandler('esx:playerLoaded', function(xPlayer)
  17.   PlayerData = xPlayer
  18. end)
  19.  
  20. RegisterNetEvent('esx:setJob')
  21. AddEventHandler('esx:setJob', function(job)
  22.   PlayerData.job = job
  23. end)
  24.  
  25.    
  26. RegisterServerEvent('OD:updateState')
  27. AddEventHandler('OD:updateState', function(doorID, state)
  28.  
  29. end)
  30.  
  31. function IsJobTrue()
  32.     if PlayerData.job ~= nil then
  33.        local IsJobTrue = false
  34.             if PlayerData.job ~=nil  and PlayerData.job == 'cartel' then
  35.               IsJobTrue = true
  36.                
  37.     end
  38.    
  39.  
  40.         if IsJobTrue == nil then
  41.           local canuse = false
  42.            if IsJobTrue ~= true then
  43.              local canuse = true
  44.              end
  45.         end
  46.     end
  47.         if canuse then
  48.         lockState[doorID] = {}
  49.         lockState[doorID].state = state
  50.         lockState[doorID].doorID = doorID
  51.         TriggerClientEvent('OD:state', -1, doorID, state)
  52.         end
  53.     end
Add Comment
Please, Sign In to add comment