Skip to content

Commit

Permalink
feat(resource/cache): cache.weapon (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
BerkieBb authored Nov 8, 2022
1 parent 306b7b3 commit 5044473
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions resource/cache/client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ end
local GetVehiclePedIsIn = GetVehiclePedIsIn
local GetPedInVehicleSeat = GetPedInVehicleSeat
local GetVehicleMaxNumberOfPassengers = GetVehicleMaxNumberOfPassengers
local GetCurrentPedWeapon = GetCurrentPedWeapon

CreateThread(function()
while true do
Expand All @@ -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)
Expand Down

0 comments on commit 5044473

Please sign in to comment.