SHARE
TWEET

Untitled

a guest Jun 18th, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. --------------------CLIENT-----------------------
  2.  
  3.  
  4. ESX               = nil
  5.  
  6.  
  7.  
  8. Citizen.CreateThread(function()
  9.     while ESX == nil do
  10.         TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  11.         Citizen.Wait(0)
  12.     end
  13. end)
  14. RegisterCommand("test", function()
  15.  
  16.  local closestPlayer, closestDistance = ESX.Game.GetClosestPlayer(gracz)
  17.             if closestPlayer == -1 or closestDistance > 3.0 then
  18.                 ESX.ShowNotification("Brak graczy")
  19.             else
  20.                 TriggerServerEvent('bron_wydaj', gracz)
  21.                
  22.             end
  23. end)
  24.  
  25.  
  26. -----------------SERVER----------------------
  27. ESX = nil
  28.  
  29. TriggerEvent('esx:getSharedObject', function(obj) ESX = obj end)
  30.  
  31. function LoadLicenses (source)
  32.   TriggerEvent('esx_license:getLicenses', source, function (licenses)
  33.     TriggerClientEvent('esx_weashop:loadLicenses', source, licenses)
  34.   end)
  35. end
  36.  
  37. RegisterServerEvent('bron_wydaj')
  38. AddEventHandler('bron_wydaj', function()
  39.  
  40.     TriggerEvent('esx_license:addLicense', gracz, 'weapon', function ()
  41.       LoadLicenses(gracz)
  42.     end)
  43.  
  44. end)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top