mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-16 22:46:03 +01:00
feat(resource/cache): cache.weapon (#151)
This commit is contained in:
5
resource/cache/client.lua
vendored
5
resource/cache/client.lua
vendored
@@ -13,6 +13,7 @@ end
|
||||
local GetVehiclePedIsIn = GetVehiclePedIsIn
|
||||
local GetPedInVehicleSeat = GetPedInVehicleSeat
|
||||
local GetVehicleMaxNumberOfPassengers = GetVehicleMaxNumberOfPassengers
|
||||
local GetCurrentPedWeapon = GetCurrentPedWeapon
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
@@ -37,6 +38,10 @@ CreateThread(function()
|
||||
cache:set('seat', false)
|
||||
end
|
||||
|
||||
local hasWeapon, currentWeapon = GetCurrentPedWeapon(ped, true)
|
||||
|
||||
cache:set('weapon', hasWeapon and currentWeapon or false)
|
||||
|
||||
Wait(100)
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user