[ESX] Weapon Extensions | Addon Items

My bad I misunderstood what you meant lol.

Remove
SetPedComponentVariation(ped, 9, 10, 0, 0)
it’s right under the prop will look like this

if not status then
    SetPedComponentVariation(ped, 9, 10, 0, 0) -- remove this
    AddArmourToPed(ped, 30)
    exports['mythic_notify']:DoHudText('inform', 'You have put on Light Body Armor.')
end

Is there any way to add extended magazines into this too? More specifically mag2 or the drum mags that some weapons offer.

Thanks man Got it fixed.

Hello, I add this script into my server. The amour works but ammo box don’t. It just remove my item and not progress bar or notification show up. Can you help me about that?

1 Like

dosent really work :confused: https://gyazo.com/359f0636950e9a6821dfa4b01d0cdfee

1 Like

I was having the same issue with this release. To fix this issue, on an up-to-date ESX server, all you have to do is:

1.) Add the items to a shop in your database (not esx_weaponshop, because it looks for weapons and not items) such as esx_supermarket, for example.
2.) Open your client.lua and replace all 40 instances of “DoHudText” with “SendAlert”, since that has changed in mythic_notify and seems to break the current release.

Once you have done the above it should all work again. You can now buy items from the shop and use them as intended. For bonus points, add some images to your esx_inventoryhud and esx_supermarket to make it look nice.

Another thing I noticed is the notification for heavy armor says “You have put on Light Body Armor”, so you might want to change that to “You have put on Heavy Body Armor”.

Enjoy! o/

2 Likes

jimmyd
Tested works perfect, thank you.

Only problem I have: (skip to 0:21)


Character won’t stand up not matter the time limit.
1 Like

Found out that Any ammunition you have put on your weapons or armour disappears after re-logging or server restart.

What inventory hud script do you use?

samee

I took some code from esx_ambulancejob to fix this issue. This is just the event for small armor. Just copy+paste it three times over small, medium, and heavy. Then rename to small/medium/heavy where needed and change duration for the progress bar. Also change “Citizen.Wait(2500)” to your new duration, minus 2500.

(Not sure how to put the following between spoiler tags, so please pardon the wall of text)

RegisterNetEvent('nfw_wep:SmallArmor')
AddEventHandler('nfw_wep:SmallArmor', function()

    local inventory = ESX.GetPlayerData().inventory
    local lib, anim = 'rcmfanatic3', 'kneel_idle_a'
    local ped = GetPlayerPed(-1)
    local armor = GetPedArmour(ped)
    local item = 'SmallArmor'

    if(armor >= 100) or (armor+30 > 100) then
        exports['mythic_notify']:SendAlert('inform', 'Your armor is already maxed!')
        TriggerServerEvent('returnItem', item)
        return
    end

    TriggerEvent('mythic_progbar:client:progress', {
        name = 'smallb_armor',
        duration = 5000,
        label = 'Applying Light Body Armor...',
        useWhileDead = false,
        canCancel = false,
        controlDisables = {
            disableMovement = true,
            disableCarMovement = true,
            disableMouse = false,
            disableCombat = true,
        },
        prop = {
            model = "prop_bodyarmour_02",
        }
    }, function(status)
        if not status then
            SetPedComponentVariation(ped, 9, 10, 0, 0)
            exports['mythic_notify']:SendAlert('inform', 'You have put on Light Body Armor.')
        end
    end)

    ESX.Streaming.RequestAnimDict(lib, function()
        TaskPlayAnim(ped, lib, anim, 2.0, -2.0, -1, 0, 0, false, false, false)
        Citizen.Wait(2500)
        TaskPlayAnim(ped, lib, anim, 2.0, -2.0, -1, 0, 0, false, false, false)

        Citizen.Wait(500)
        while IsEntityPlayingAnim(ped, lib, anim, 3) do
            Citizen.Wait(0)
        end
        AddArmourToPed(ped, 30)
    end)

end)
1 Like

The ammo boxes doesn’t looks like to work. I can use it, but when i use it the system remove it from me but i dont get the ammo. I tried to change the ammount that it gives, but it doesnt work.

sorry for the lack of expertise the ESX is perfect, but when I try to add bullets to the weapon it does not appear to me to use …

hi
i add this script to my test server to be able to use body armor.
i can spawn the item but is no functional (no armor added).
also no animation happen when i use the item.

What is that ESX Inventory?

i cant get the ammo or the any of the other items to work… how would i go about fixing this???

everything works great for me vests ammo and accessories thanks for this also do you know how could i add a list of skins? with names you could also do scopes it would be perfect

Hello, i cannot use items. Can somebody help me? :smiley:

My vests do not work, i can use them however it does not the animation, or add armour, like nothing works could someone help me please