Bu kodu disc-ammo/client/main.lua içine yazıp dener misiniz?
Citizen.CreateThread(function()
while true do
local player = PlayerPedId()
if IsPedArmed(player, 4) then
local currentWeapon = GetSelectedPedWeapon(player)
local ammo = GetAmmoInPedWeapon(player, currentWeapon)
DisplayAmmoThisFrame(currentWeapon)
if currentWeapon ~= 911657153 then
if ammo < 2 then
DisableControlAction(0, 24, true)
DisableControlAction(0, 257, true)
if IsPedInAnyVehicle(player, true) then
DisableControlAction(0, 69, true)
DisableControlAction(0, 92, true)
end
else
EnableControlAction(0, 24, true)
EnableControlAction(0, 257, true)
if IsPedInAnyVehicle(player, true) then
EnableControlAction(0, 69, true)
EnableControlAction(0, 92, true)
end
end
if ammo <= 0 then
SetAmmoInClip(PlayerPedId(), currentWeapon, 1)
end
end
end
Citizen.Wait(5)
end
end)