”ESX is bad, you are bad”. I’m sorry but you probably don’t know my knowledge and you probably haven’t even figured out how to use ESX own accessories. Stop posting stuff you have no clue about. You just look like a moron. So please stop posting here and let him have his own post by himself. If you have any problems or want to argue, take that in my DM’s. Bye!
Could anyone possibly share a snippet on enabling the use of med-kits and bandages through this script? I’ve tried replacing the small and medium armor with bandage and medkit and changed “AddArmorToPed (ped, xx)” to AddHealthToPed (it was a long shot, I know) and then I also tried the native SetEntityHealth and they just don’t seem to work.
Really like the idea of it taking a few seconds to use a bandage and medkit and I like the way Mythic delivers the progress bar and notification.
ESX.RegisterUsableItem('medikit', function(source)
if not playersHealing[source] then
local xPlayer = ESX.GetPlayerFromId(source)
xPlayer.removeInventoryItem('medikit', 1)
playersHealing[source] = true
TriggerClientEvent('esx_ambulancejob:useItem', source, 'medikit')
Citizen.Wait(10000)
playersHealing[source] = nil
end
end)
That would be great however for this particular server I’m not running esx_ambulancejob. I’m creating an “anarchy” server that’s generally just a death match type deal and I have esx_wasted handling my death functions rather than ambulance job because esx_wasted will send you to a random hospital and not all the same hospital.
You have to change the amount of ammo the Weapon can hold and how much you want it to Refill.
Be default it’s set at 250 and refill is 50.
You have to go into the client/main.lua and change the lines starting from 325 with Pistol Ammo to go along with what you have the ammo set to on your server.
OR, you can change all your ammo for weapons to the higher value to work.
RegisterNetEvent(‘nfw_wep:pAmmo’)
AddEventHandler(‘nfw_wep:pAmmo’, function()
local ped = GetPlayerPed(-1)
local currentWeaponHash = GetSelectedPedWeapon(ped)
local ammo = GetAmmoInPedWeapon(ped, currentWeaponHash)
local item = “pAmmo”
**if(ammo >= 42 or ammo + 14 > 42)** <-----THIS IS WHAT YOU CHANGE then
exports['mythic_notify']:DoHudText('inform', 'Your weapon ammo is already maxed!')
TriggerServerEvent('returnItem', item)
return
end
if table.includes(pistol, currentWeaponHash) then
exports['mythic_notify']:DoHudText('inform', 'Added 14 more Pistol ammo')
AddAmmoToPed(ped, currentWeaponHash, 14)<----THIS NUMBER NEEDS TO BE CHANGED AS WELL
else
exports['mythic_notify']:DoHudText('inform', 'This weapon is not compatible with this ammo')
TriggerServerEvent('returnItem', item)
end
when im using this with EUP. its placing a cop vest on the person.
is there any way i can make it not put anything on the player and just add the armor ?