[Help] unlimited ammo script no menu

anyone know if they can make a code line for unlimited ammo
i want to do it for the fire script for the fire extinguisher

1 Like

SetPedInfiniteAmmo(ped, toggle, weaponHash) You mean like that?

that is great any way just to make it for a fire extinguisher.

local ped = GetPlayerPed(-1)
SetPedInfiniteAmmo(ped, true, "WEAPON_FIREEXTINGUISHER")

I believe

i try it out thanks my guys are going to love to be able to get the firefighting training
now

1 Like

how can i trigger it

worked it out thanks so much here it is for anyone else SetPedInfiniteAmmo(GetPlayerPed(-1), true, GetHashKey(“WEAPON_FIREEXTINGUISHER”))

2 Likes

change GetPlayerPed(-1) to PlayerPedId() Its the same but smaller :wink: and please use code formatting

sorry but where do i have to put it ?

1 Like
Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
        snowball()
    end
end)

function snowball()
    SetPedInfiniteAmmo(GetPlayerPed(-1), true, GetHashKey("WEAPON_FIREEXTINGUISHER"))
        
end
2 Likes

and for all weapons?

1 Like

Did you find how to do it for all weapons?

local playerPed = GetPlayerPed(-1)
local weaponHash = GetHashKey(args[1])

SetPedInfiniteAmmo(playerPed, true, weaponHash)