QB
Code
Paste the following code anywhere inside your script:
qb-weapons/client/main.lua
RegisterNetEvent("weapons:client:updateWeaponAmmo")
AddEventHandler("weapons:client:updateWeaponAmmo", function(ammoCount)
-- Avoid making any changes if you're uncertain about your actions.
if CurrentWeaponData and type(CurrentWeaponData) == "table" and type(ammoCount) == "number" then
TriggerServerEvent("weapons:server:UpdateWeaponAmmo", CurrentWeaponData, ammoCount)
else
print("[ERROR]: The provided data is not valid.")
end
end)Last updated