Simple armour script for ESX that comes with the following as usable items:
Light Armour (25/100)
Medium Armour (50/100)
Heavy Armour (75/100)
Military Armour (100/100)
It plays a sound and animation when armour is applied to your character and if they die it will remove the armour. I am working on the script recognising female/male peds so the vest varients are the same. It still works for now though.
This is my first release so please let me know if I can improve the script in anyway or if I could optimise it.
My inital thought was to take a look at the esx_ambulancejob as it has a āanti-combatlogā feature that checks if a player should be dead upon re-entering the server
BUT
I saw this on the forums which I think will do the same job (here)
Using that script you can probably do something on the lines of this for a player joined (probably will not work as ive not tested but you get the idea of it). Obviously credits go out to the original creator of that script.
if tonumber(armour) <= 25 then
TriggerClientEvent('D2D-Armor:Light', source)
elseif tonumber(armour) > 25 or <= 50 then
TriggerClientEvent('D2D-Armor:Medium', source)
elseif tonumber(armour) > 50 or <= 75 then
TriggerClientEvent('D2D-Armor:Heavy', source)
elseif tonumber(armour) > 75 or <= 100 then
TriggerClientEvent('D2D-Armor:Military', source)
end)
hi now if u use the item its turning your bodyvest on can u maybe add a option that if u click again its turns the body vest off when you finished with your scenarion should be really nice ! or u have the code for it