Advertisement
Guest User

Untitled

a guest
Sep 23rd, 2018
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 16.41 KB | None | 0 0
  1. local Keys = {
  2.   ["ESC"] = 322, ["F1"] = 288, ["F2"] = 289, ["F3"] = 170, ["F5"] = 166, ["F6"] = 167, ["F7"] = 168, ["F8"] = 169, ["F9"] = 56, ["F10"] = 57,
  3.   ["~"] = 243, ["1"] = 157, ["2"] = 158, ["3"] = 160, ["4"] = 164, ["5"] = 165, ["6"] = 159, ["7"] = 161, ["8"] = 162, ["9"] = 163, ["-"] = 84, ["="] = 83, ["BACKSPACE"] = 177,
  4.   ["TAB"] = 37, ["Q"] = 44, ["W"] = 32, ["E"] = 38, ["R"] = 45, ["T"] = 245, ["Y"] = 246, ["U"] = 303, ["P"] = 199, ["["] = 39, ["]"] = 40, ["ENTER"] = 18,
  5.   ["CAPS"] = 137, ["A"] = 34, ["S"] = 8, ["D"] = 9, ["F"] = 23, ["G"] = 47, ["H"] = 74, ["K"] = 311, ["L"] = 182,
  6.   ["LEFTSHIFT"] = 21, ["Z"] = 20, ["X"] = 73, ["C"] = 26, ["V"] = 0, ["B"] = 29, ["N"] = 249, ["M"] = 244, [","] = 82, ["."] = 81,
  7.   ["LEFTCTRL"] = 36, ["LEFTALT"] = 19, ["SPACE"] = 22, ["RIGHTCTRL"] = 70,
  8.   ["HOME"] = 213, ["PAGEUP"] = 10, ["PAGEDOWN"] = 11, ["DELETE"] = 178,
  9.   ["LEFT"] = 174, ["RIGHT"] = 175, ["TOP"] = 27, ["DOWN"] = 173,
  10.   ["NENTER"] = 201, ["N4"] = 108, ["N5"] = 60, ["N6"] = 107, ["N+"] = 96, ["N-"] = 97, ["N7"] = 117, ["N8"] = 61, ["N9"] = 118
  11. }
  12.  
  13. local GUI           = {}
  14. GUI.Time            = 0
  15. local LoadoutLoaded = false
  16. local IsPaused      = false
  17. local PlayerSpawned = false
  18. local LastLoadout   = {}
  19. local Pickups       = {}
  20. local isDead        = false
  21. local color = {r = 37, g = 175, b = 134, alpha = 255} -- Color of the text
  22. local font = 0 -- Font of the text
  23. local time = 7000 -- Duration of the display of the text : 1000ms = 1sec
  24. local nbrDisplaying = 0
  25.  
  26. RegisterNetEvent('esx:playerLoaded')
  27. AddEventHandler('esx:playerLoaded', function(xPlayer)
  28.   TriggerServerEvent("esx:updateConnexion")
  29.  
  30.   ESX.PlayerLoaded  = true
  31.   ESX.PlayerData    = xPlayer
  32.  
  33.   for i=1, #xPlayer.accounts, 1 do
  34.  
  35.    if xPlayer.accounts[i].name == 'bank' then
  36.     local accountTpl = '<div><img src="img/accounts/' .. xPlayer.accounts[i].name .. '.png"/>&nbsp;{{money}}</div>'
  37.  
  38.     ESX.UI.HUD.RegisterElement('account_' .. xPlayer.accounts[i].name, i-1, 0, accountTpl, {
  39.       money = 0
  40.     })
  41.  
  42.     ESX.UI.HUD.UpdateElement('account_' .. xPlayer.accounts[i].name, {
  43.       money = xPlayer.accounts[i].money
  44.     })
  45.     elseif xPlayer.accounts[i].name == 'black_money' then
  46.     local accountTpl = '<div><img src="img/accounts/' .. xPlayer.accounts[i].name .. '.png"/>&nbsp;<span style="color:red;">{{money}}</span></div>'
  47.  
  48.     ESX.UI.HUD.RegisterElement('account_' .. xPlayer.accounts[i].name, i-1, 0, accountTpl, {
  49.       money = 0
  50.     })
  51.  
  52.     ESX.UI.HUD.UpdateElement('account_' .. xPlayer.accounts[i].name, {
  53.       money = xPlayer.accounts[i].money
  54.     })
  55.     end
  56.   end
  57.  
  58.   local moneyTpl = '<div><img src="img/accounts/cash.png"/>{{money}}</div>'
  59.  
  60.   ESX.UI.HUD.RegisterElement('money', 1, 0, moneyTpl, {
  61.     money = 0
  62.   })
  63.  
  64.   ESX.UI.HUD.UpdateElement('money', {
  65.     money = xPlayer.money
  66.   })
  67.  
  68.   local jobTpl = '<div>{{job_label}} - {{grade_label}}</div>'
  69.  
  70.  
  71.   if xPlayer.job.grade_label == '' then
  72.     jobTpl = '<div>{{job_label}}</div>'
  73.   end
  74.  
  75.   ESX.UI.HUD.RegisterElement('job', #xPlayer.accounts, 0, jobTpl, {
  76.     job_label   = '',
  77.     grade_label = ''
  78.   })
  79.  
  80.   ESX.UI.HUD.UpdateElement('job', {
  81.     job_label   = xPlayer.job.label,
  82.     grade_label = xPlayer.job.grade_label
  83.   })
  84.  
  85.  local factionTpl ='<div>{{faction_label}} - {{faction_grade_label}}'
  86.  
  87.   ESX.UI.HUD.RegisterElement('faction' , #xPlayer.accounts, 0 , factionTpl ,{
  88.     faction_label = '' ,
  89.     faction_grade_label = ''
  90.   })
  91.  
  92.   ESX.UI.HUD.UpdateElement('faction', {
  93.   faction_label   = xPlayer.faction.label,
  94.   faction_grade_label = xPlayer.faction.grade_label
  95.   })
  96.  
  97.   end)
  98.  
  99. AddEventHandler('playerSpawned', function()
  100.   while not ESX.PlayerLoaded do
  101.     Citizen.Wait(1)
  102.   end
  103.  
  104.   local playerPed = GetPlayerPed(-1)
  105.  
  106.   -- Restore position
  107.   if ESX.PlayerData.lastPosition ~= nil then
  108.     SetEntityCoords(playerPed,  ESX.PlayerData.lastPosition.x,  ESX.PlayerData.lastPosition.y,  ESX.PlayerData.lastPosition.z)
  109.   end
  110.  
  111.   TriggerEvent('esx:restoreLoadout') -- restore loadout
  112.  
  113.   LoadoutLoaded = true
  114.   PlayerSpawned = true
  115.   isDead = false
  116. end)
  117.  
  118. AddEventHandler('baseevents:onPlayerDied', function(killerType, coords)
  119.   TriggerEvent('esx:onPlayerDeath')
  120. end)
  121.  
  122. AddEventHandler('baseevents:onPlayerKilled', function(killerId, data)
  123.   TriggerEvent('esx:onPlayerDeath')
  124. end)
  125.  
  126. AddEventHandler('esx:onPlayerDeath', function()
  127.   isDead = true
  128. end)
  129.  
  130. AddEventHandler('skinchanger:loadDefaultModel', function()
  131.   LoadoutLoaded = false
  132. end)
  133.  
  134. AddEventHandler('skinchanger:modelLoaded', function()
  135.   while not ESX.PlayerLoaded do
  136.     Citizen.Wait(1)
  137.   end
  138.  
  139.   TriggerEvent('esx:restoreLoadout')
  140. end)
  141.  
  142. AddEventHandler('esx:restoreLoadout', function ()
  143.   local playerPed = GetPlayerPed(-1)
  144.  
  145.   RemoveAllPedWeapons(playerPed, true)
  146.  
  147.   for i=1, #ESX.PlayerData.loadout, 1 do
  148.     local weaponHash = GetHashKey(ESX.PlayerData.loadout[i].name)
  149.     GiveWeaponToPed(playerPed, weaponHash, ESX.PlayerData.loadout[i].ammo, false, false)
  150.   end
  151.  
  152.   LoadoutLoaded = true
  153. end)
  154.  
  155. RegisterNetEvent('esx:setAccountMoney')
  156. AddEventHandler('esx:setAccountMoney', function(account)
  157.  
  158.   for i=1, #ESX.PlayerData.accounts, 1 do
  159.     if ESX.PlayerData.accounts[i].name == account.name then
  160.       ESX.PlayerData.accounts[i] = account
  161.     end
  162.   end
  163.  
  164.   ESX.UI.HUD.UpdateElement('account_' .. account.name, {
  165.     money = account.money
  166.   })
  167. end)
  168.  
  169. RegisterNetEvent('es:activateMoney')
  170. AddEventHandler('es:activateMoney', function(money)
  171.  
  172.   ESX.PlayerData.money = money
  173.  
  174.   ESX.UI.HUD.UpdateElement('money', {
  175.     money = money
  176.   })
  177.  
  178. end)
  179.  
  180. RegisterNetEvent('esx:addInventoryItem')
  181. AddEventHandler('esx:addInventoryItem', function(item, count)
  182.  
  183.   for i=1, #ESX.PlayerData.inventory, 1 do
  184.     if ESX.PlayerData.inventory[i].name == item.name then
  185.       ESX.PlayerData.inventory[i] = item
  186.     end
  187.   end
  188.  
  189.   ESX.UI.ShowInventoryItemNotification(true, item, count)
  190.  
  191.   if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
  192.     ESX.ShowInventory()
  193.   end
  194.  
  195. end)
  196.  
  197. RegisterNetEvent('esx:removeInventoryItem')
  198. AddEventHandler('esx:removeInventoryItem', function(item, count)
  199.  
  200.   for i=1, #ESX.PlayerData.inventory, 1 do
  201.     if ESX.PlayerData.inventory[i].name == item.name then
  202.       ESX.PlayerData.inventory[i] = item
  203.     end
  204.   end
  205.  
  206.   ESX.UI.ShowInventoryItemNotification(false, item, count)
  207.  
  208.   if ESX.UI.Menu.IsOpen('default', 'es_extended', 'inventory') then
  209.     ESX.ShowInventory()
  210.   end
  211.  
  212. end)
  213.  
  214. RegisterNetEvent('esx:setJob')
  215. AddEventHandler('esx:setJob', function(job)
  216.   ESX.PlayerData.job = job
  217. end)
  218.  
  219. RegisterNetEvent('esx:setFaction')
  220. AddEventHandler('esx:setFaction', function(faction)
  221.   ESX.PlayerData.faction = faction
  222. end)
  223.  
  224. RegisterNetEvent('esx:addWeapon')
  225. AddEventHandler('esx:addWeapon', function(weaponName, ammo)
  226.   local playerPed  = GetPlayerPed(-1)
  227.   local weaponHash = GetHashKey(weaponName)
  228.  
  229.   GiveWeaponToPed(playerPed, weaponHash, ammo, false, false)
  230.   SetPedAmmo(playerPed, weaponHash, ammo) -- remove leftover ammo
  231. end)
  232.  
  233. RegisterNetEvent('esx:removeWeapon')
  234. AddEventHandler('esx:removeWeapon', function(weaponName)
  235.   local playerPed  = GetPlayerPed(-1)
  236.   local weaponHash = GetHashKey(weaponName)
  237.  
  238.   RemoveWeaponFromPed(playerPed,  weaponHash)
  239.   SetPedAmmo(playerPed, weaponHash, 0) -- remove leftover ammo
  240. end)
  241.  
  242. -- Commands
  243. RegisterNetEvent('esx:teleport')
  244. AddEventHandler('esx:teleport', function(pos)
  245.  
  246.   pos.x = pos.x + 0.0
  247.   pos.y = pos.y + 0.0
  248.   pos.z = pos.z + 0.0
  249.  
  250.   RequestCollisionAtCoord(pos.x, pos.y, pos.z)
  251.  
  252.   while not HasCollisionLoadedAroundEntity(GetPlayerPed(-1)) do
  253.     RequestCollisionAtCoord(pos.x, pos.y, pos.z)
  254.     Citizen.Wait(1)
  255.   end
  256.  
  257.   SetEntityCoords(GetPlayerPed(-1), pos.x, pos.y, pos.z)
  258.  
  259. end)
  260.  
  261. RegisterNetEvent('esx:setJob')
  262. AddEventHandler('esx:setJob', function(job)
  263.   ESX.UI.HUD.UpdateElement('job', {
  264.     job_label   = job.label,
  265.     grade_label = job.grade_label
  266.   })
  267. end)
  268.  
  269. RegisterNetEvent('esx:setFaction')
  270. AddEventHandler('esx:setFaction', function(faction)
  271.   ESX.UI.HUD.UpdateElement('faction', {
  272.     faction_label   = faction.label,
  273.     faction_grade_label = faction.grade_label
  274.   })
  275. end)
  276.  
  277. RegisterNetEvent('esx:loadIPL')
  278. AddEventHandler('esx:loadIPL', function(name)
  279.  
  280.   Citizen.CreateThread(function()
  281.     LoadMpDlcMaps()
  282.     EnableMpDlcMaps(true)
  283.     RequestIpl(name)
  284.   end)
  285.  
  286. end)
  287.  
  288. RegisterNetEvent('esx:unloadIPL')
  289. AddEventHandler('esx:unloadIPL', function(name)
  290.  
  291.   Citizen.CreateThread(function()
  292.     RemoveIpl(name)
  293.   end)
  294.  
  295. end)
  296.  
  297. RegisterNetEvent('esx:playAnim')
  298. AddEventHandler('esx:playAnim', function(dict, anim)
  299.  
  300.   Citizen.CreateThread(function()
  301.  
  302.     local pid = PlayerPedId()
  303.  
  304.     RequestAnimDict(dict)
  305.  
  306.     while not HasAnimDictLoaded(dict) do
  307.       Citizen.Wait(1)
  308.     end
  309.  
  310.     TaskPlayAnim(pid, dict, anim, 1.0, -1.0, 20000, 0, 1, true, true, true)
  311.  
  312.   end)
  313.  
  314. end)
  315.  
  316. RegisterNetEvent('esx:playEmote')
  317. AddEventHandler('esx:playEmote', function(emote)
  318.  
  319.   Citizen.CreateThread(function()
  320.  
  321.     local playerPed = GetPlayerPed(-1)
  322.  
  323.     TaskStartScenarioInPlace(playerPed, emote, 0, false);
  324.     Citizen.Wait(20000)
  325.     ClearPedTasks(playerPed)
  326.  
  327.   end)
  328.  
  329. end)
  330.  
  331. RegisterNetEvent('esx:spawnVehicle')
  332. AddEventHandler('esx:spawnVehicle', function(model)
  333.  
  334.   local playerPed = GetPlayerPed(-1)
  335.   local coords    = GetEntityCoords(playerPed)
  336.  
  337.   ESX.Game.SpawnVehicle(model, coords, 90.0, function(vehicle)
  338.     TaskWarpPedIntoVehicle(playerPed,  vehicle, -1)
  339.   end)
  340.  
  341. end)
  342.  
  343. RegisterNetEvent('esx:spawnObject')
  344. AddEventHandler('esx:spawnObject', function(model)
  345.  
  346.   local playerPed = GetPlayerPed(-1)
  347.   local coords    = GetEntityCoords(playerPed)
  348.   local forward   = GetEntityForwardVector(playerPed)
  349.   local x, y, z   = table.unpack(coords + forward * 1.0)
  350.  
  351.   ESX.Game.SpawnObject(model, {
  352.     x = x,
  353.     y = y,
  354.     z = z
  355.   }, function(obj)
  356.     SetEntityHeading(obj, GetEntityHeading(playerPed))
  357.     PlaceObjectOnGroundProperly(obj)
  358.   end)
  359.  
  360. end)
  361.  
  362. RegisterNetEvent('esx:pickup')
  363. AddEventHandler('esx:pickup', function(id, label, player)
  364.  
  365.   local ped     = GetPlayerPed(GetPlayerFromServerId(player))
  366.   local coords  = GetEntityCoords(ped)
  367.   local forward = GetEntityForwardVector(ped)
  368.   local x, y, z = table.unpack(coords + forward * -2.0)
  369.  
  370.   ESX.Game.SpawnLocalObject('prop_money_bag_01', {
  371.       x = x,
  372.       y = y,
  373.       z = z - 2.0,
  374.     }, function(obj)
  375.  
  376.     SetEntityAsMissionEntity(obj,  true,  false)
  377.  
  378.     PlaceObjectOnGroundProperly(obj)
  379.  
  380.     Pickups[id] = {
  381.       id = id,
  382.       obj = obj,
  383.       label = label,
  384.       inRange = false,
  385.       coords = {
  386.         x = x,
  387.         y = y,
  388.         z = z
  389.       },
  390.     }
  391.  
  392.   end)
  393.  
  394. end)
  395.  
  396. RegisterNetEvent('esx:removePickup')
  397. AddEventHandler('esx:removePickup', function(id)
  398.   ESX.Game.DeleteObject(Pickups[id].obj)
  399.   Pickups[id] = nil
  400. end)
  401.  
  402. RegisterNetEvent('esx:pickupWeapon')
  403. AddEventHandler('esx:pickupWeapon', function(weaponPickup, weaponName,ammo)
  404.  
  405.   local ped          = GetPlayerPed(-1)
  406.   local playerPedPos = GetEntityCoords(ped, true)
  407.   CreateAmbientPickup(GetHashKey(weaponPickup), playerPedPos.x + 2.0, playerPedPos.y, playerPedPos.z + 0.5, 0, ammo, 1, false, true)
  408.  
  409. end)
  410.  
  411. RegisterNetEvent('esx:spawnPed')
  412. AddEventHandler('esx:spawnPed', function(model)
  413.  
  414.   model           = (tonumber(model) ~= nil and tonumber(model) or GetHashKey(model))
  415.   local playerPed = GetPlayerPed(-1)
  416.   local coords    = GetEntityCoords(playerPed)
  417.   local forward   = GetEntityForwardVector(playerPed)
  418.   local x, y, z   = table.unpack(coords + forward * 1.0)
  419.  
  420.   Citizen.CreateThread(function()
  421.  
  422.     RequestModel(model)
  423.  
  424.     while not HasModelLoaded(model)  do
  425.       Citizen.Wait(1)
  426.     end
  427.  
  428.     CreatePed(5,  model,  x,  y,  z,  0.0,  true,  false)
  429.  
  430.   end)
  431.  
  432. end)
  433.  
  434. RegisterNetEvent('esx:deleteVehicle')
  435. AddEventHandler('esx:deleteVehicle', function()
  436.  
  437.   local playerPed = GetPlayerPed(-1)
  438.   local coords    = GetEntityCoords(playerPed)
  439.  
  440.   if IsPedInAnyVehicle(playerPed,  false) then
  441.  
  442.     local vehicle = GetVehiclePedIsIn(playerPed,  false)
  443.     ESX.Game.DeleteVehicle(vehicle)
  444.  
  445.   elseif IsAnyVehicleNearPoint(coords.x,  coords.y,  coords.z,  5.0) then
  446.  
  447.     local vehicle = GetClosestVehicle(coords.x,  coords.y,  coords.z,  5.0,  0,  71)
  448.     ESX.Game.DeleteVehicle(vehicle)
  449.  
  450.   end
  451.  
  452. end)
  453.  
  454.  
  455. -- Pause menu disable HUD display
  456. Citizen.CreateThread(function()
  457.   while true do
  458.     Citizen.Wait(1)
  459.     if IsPauseMenuActive() and not IsPaused then
  460.       IsPaused = true
  461.       TriggerEvent('es:setMoneyDisplay', 0.0)
  462.       ESX.UI.HUD.SetDisplay(0.0)
  463.     elseif not IsPauseMenuActive() and IsPaused then
  464.       IsPaused = false
  465.       TriggerEvent('es:setMoneyDisplay', 1.0)
  466.       ESX.UI.HUD.SetDisplay(1.0)
  467.     end
  468.   end
  469. end)
  470.  
  471. -- Save loadout
  472. Citizen.CreateThread(function()
  473.  
  474.   while true do
  475.  
  476.     Citizen.Wait(1)
  477.  
  478.     local playerPed      = GetPlayerPed(-1)
  479.     local loadout        = {}
  480.     local loadoutChanged = false
  481.  
  482.     if IsPedDeadOrDying(playerPed) then
  483.       LoadoutLoaded = false
  484.     end
  485.  
  486.     for i=1, #Config.Weapons, 1 do
  487.  
  488.       local weaponHash = GetHashKey(Config.Weapons[i].name)
  489.  
  490.       if HasPedGotWeapon(playerPed,  weaponHash,  false) and Config.Weapons[i].name ~= 'WEAPON_UNARMED' then
  491.  
  492.         local ammo = GetAmmoInPedWeapon(playerPed, weaponHash)
  493.  
  494.         if LastLoadout[Config.Weapons[i].name] == nil or LastLoadout[Config.Weapons[i].name] ~= ammo then
  495.           loadoutChanged = true
  496.         end
  497.  
  498.         LastLoadout[Config.Weapons[i].name] = ammo
  499.  
  500.         table.insert(loadout, {
  501.           name  = Config.Weapons[i].name,
  502.           ammo  = ammo,
  503.           label = Config.Weapons[i].label
  504.         })
  505.  
  506.       else
  507.  
  508.         if LastLoadout[Config.Weapons[i].name] ~= nil then
  509.           loadoutChanged = true
  510.         end
  511.  
  512.         LastLoadout[Config.Weapons[i].name] = nil
  513.  
  514.       end
  515.  
  516.     end
  517.  
  518.     if loadoutChanged and LoadoutLoaded then
  519.       ESX.PlayerData.loadout = loadout
  520.       TriggerServerEvent('esx:updateLoadout', loadout)
  521.     end
  522.  
  523.   end
  524. end)
  525.  
  526. -- Dot above head
  527. if Config.ShowDotAbovePlayer then
  528.  
  529.   Citizen.CreateThread(function()
  530.     while true do
  531.  
  532.       Citizen.Wait(0)
  533.  
  534.       local players = ESX.Game.GetPlayers()
  535.  
  536.       for i = 1, #players, 1 do
  537.         if players[i] ~= PlayerId() then
  538.           local ped    = GetPlayerPed(players[i])
  539.           local headId = Citizen.InvokeNative(0xBFEFE3321A3F5015, ped, ('·'), false, false, '', false)
  540.         end
  541.       end
  542.  
  543.     end
  544.   end)
  545.  
  546. end
  547.  
  548. -- Disable wanted level
  549. if Config.DisableWantedLevel then
  550.  
  551.   Citizen.CreateThread(function()
  552.     while true do
  553.  
  554.       Citizen.Wait(10)
  555.  
  556.       local playerId = PlayerId()
  557.  
  558.       if GetPlayerWantedLevel(playerId) ~= 0 then
  559.         SetPlayerWantedLevel(playerId, 0, false)
  560.         SetPlayerWantedLevelNow(playerId, false)
  561.       end
  562.  
  563.     end
  564.   end)
  565.  
  566. end
  567.  
  568. -- Pickups
  569. Citizen.CreateThread(function()
  570.   while true do
  571.  
  572.     Citizen.Wait(0)
  573.  
  574.     local playerPed = GetPlayerPed(-1)
  575.     local coords    = GetEntityCoords(playerPed)
  576.  
  577.     for k,v in pairs(Pickups) do
  578.  
  579.       local distance = GetDistanceBetweenCoords(coords.x,  coords.y,  coords.z,  v.coords.x,  v.coords.y,  v.coords.z,  true)
  580.  
  581.       if distance <= 5.0 then
  582.  
  583.         ESX.Game.Utils.DrawText3D({
  584.           x = v.coords.x,
  585.           y = v.coords.y,
  586.           z = v.coords.z + 0.25
  587.         }, v.label)
  588.  
  589.       end
  590.  
  591.       if distance <= 1.0 and not v.inRange and not IsPedSittingInAnyVehicle(playerPed) then
  592.         TriggerServerEvent('esx:onPickup', v.id)
  593.         v.inRange = true
  594.       end
  595.  
  596.     end
  597.  
  598.   end
  599. end)
  600.  
  601. -- Last position
  602. Citizen.CreateThread(function()
  603.  
  604.   while true do
  605.  
  606.     Citizen.Wait(1000)
  607.  
  608.     if ESX ~= nil and ESX.PlayerLoaded and PlayerSpawned then
  609.  
  610.       local playerPed = GetPlayerPed(-1)
  611.       local coords    = GetEntityCoords(playerPed)
  612.  
  613.       if not IsEntityDead(playerPed) then
  614.         ESX.PlayerData.lastPosition = {x = coords.x, y = coords.y, z = coords.z}
  615.       end
  616.  
  617.     end
  618.  
  619.   end
  620.  
  621. end)
  622.  
  623. Citizen.CreateThread(function()
  624.  
  625.   while true do
  626.  
  627.     Citizen.Wait(10)
  628.  
  629.     local playerPed = GetPlayerPed(-1)
  630.  
  631.     if IsEntityDead(playerPed) and PlayerSpawned then
  632.       PlayerSpawned = false
  633.     end
  634.   end
  635.  
  636. end)
  637.  
  638. ---------------------------------------------------------------------------------------------------------
  639. --NB : gestion des menu
  640. ---------------------------------------------------------------------------------------------------------
  641.  
  642. RegisterNetEvent('NB:openMenuInventaire')
  643. AddEventHandler('NB:openMenuInventaire', function()
  644.   ESX.ShowInventory()
  645. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement