Installation Guide

Follow these steps for flawless installation

  1. Download the script from your keymaster.

  2. Place the script into your server resource folder: FXServer\server-data\resources\fivecode_armor

  3. Write the script into your server.cfg: ensure fivecode_armor

  4. Setup your inventory:

ox

Add the following into: ox_inventory\modules\items\client.lua

Item('bulletproofvest', function(data, slot)
    TriggerServerEvent('fivecode_armor:useVest', slot)
end)

Item('plate', function(data, slot)
    TriggerServerEvent('fivecode_armor:usePlate', slot)
end)

and this into: ox_inventory\data\items.lua

['bulletproofvest'] = {	
     label = 'Bulletproof Vest',
     description = 'New vest from god',
     stack = false,
     close = true,
},

['plate'] = {
    label = 'Plate',
    description = 'Plate in your vest',
    stack = true,
    close = true,
},
qb

Add the following into: qb-core\shared\items.lua

bulletproofvest =  {
    name =  'bulletproofvest',
    label =  'Bulletproof vest',
    weight =  1,
    type =  'item',
    image =  'armor.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'Bulletproof vest is good.'
},

plate =  {
    name =  'plate',
    label =  'Repairing plate',
    weight =  1,
    type =  'item',
    image =  'vestplate.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'With this you can repair your vest.'
},

And this to: qb-inventory/html/js/app.js

New:
else if (itemData.name == "plate") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Strength: </strong><span>${itemData.info.strength}</span></p>
    `;
}

else if (itemData.name == "bulletproofvest") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Armor: </strong><span>${itemData.info.armor}/${itemData.info.maxArmor}</span></p>
    `;
}

Old:
else if (itemData.name == "plate") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Strenght: </strong><span>" +
        itemData.info.strenght+
        "</span></p>"
    );
}

else if (itemData.name == "bulletproofvest") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Armor: </strong><span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "</span></p>"
    );
}
qs

Add the following into: qs-inventory\shared\items.lua

['bulletproofvest'] =  {
    ['name'] =  'bulletproofvest',
    ['label'] =  'Bulletproof vest',
    ['weight'] =  1,
    ['type'] =  'item',
    ['image'] =  'armor.png',
    ['unique'] =  true,
    ['useable'] =  true,
    ['shouldClose'] =  true,
    ['combinable'] =  nil,
    ['description'] =  'Bulletproof vest is good.'
},

['plate'] =  {
    ['name'] =  'plate',
    ['label'] =  'Repairing plate',
    ['weight'] =  1,
    ['type'] =  'item',
    ['image'] =  'vestplate.png',
    ['unique'] =  true,
    ['useable'] =  true,
    ['shouldClose'] =  true,
    ['combinable'] =  nil,
    ['description'] =  'With this you can repair your vest.'
},

And this into: qs-inventory\config\metadata.js

else if (itemData.name == "plate") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Strenght: </strong><span>" +
        itemData.info.strenght+
        "</span></p>"
    );
}

else if (itemData.name == "bulletproofvest") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Armor: </strong><span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "</span></p>"
    );
}
ps

Add the following into: qb-core\shared\items.lua

bulletproofvest =  {
    name =  'bulletproofvest',
    label =  'Bulletproof vest',
    weight =  1,
    type =  'item',
    image =  'armor.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'Bulletproof vest is good.'
},

plate =  {
    name =  'plate',
    label =  'Repairing plate',
    weight =  1,
    type =  'item',
    image =  'vestplate.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'With this you can repair your vest.'
},

And this to: ps-inventory/html/js/app.js

New:
else if (itemData.name == "plate") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Strength: </strong><span>${itemData.info.strength}</span></p>
    `;
}

else if (itemData.name == "bulletproofvest") {
    return `
        <p><strong>${itemData.info.label}</strong></p>
        <p><strong>Armor: </strong><span>${itemData.info.armor}/${itemData.info.maxArmor}</span></p>
    `;
}

Old:
else if (itemData.name == "plate") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Strenght: </strong><span>" +
        itemData.info.strenght+
        "</span></p>"
    );
}

else if (itemData.name == "bulletproofvest") {
    $(".item-info-title").html("<p>" + itemData.info.label + "</p>");
    $(".item-info-description").html(
        "<p><strong>Armor: </strong><span>" +
        itemData.info.armor + "/" + itemData.info.maxArmor +
    "</span></p>"
    );
}
codem

Add the following into: codem-inventory\config\itemlist.lua

bulletproofvest =  {
    name =  'bulletproofvest',
    label =  'Bulletproof vest',
    weight =  1,
    type =  'item',
    image =  'armor.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'Bulletproof vest is good.'
},

plate =  {
    name =  'plate',
    label =  'Repairing plate',
    weight =  1,
    type =  'item',
    image =  'vestplate.png',
    unique =  true,
    useable =  true,
    shouldClose =  true,
    combinable =  nil,
    description =  'With this you can repair your vest.'
},
core

Add the following into your database:

INSERT INTO `items` (`name`, `label`, `weight`, `rare`, `can_remove`, `desc`) VALUES
    ('bulletproofvest', 'Bulletproof vest', 1, 0, 1, NULL),
    ('plate', 'Repairing plate', 1, 0, 1, NULL);
  1. Configure everything to your liking in Config.lua.

  2. Add the following into your database:

ALTER TABLE `users` ADD COLUMN IF NOT EXISTS `armor` LONGTEXT DEFAULT NULL;
  1. Restart your inventory script and start fivecode_armor, or restart your server.

  2. Enjoy the script!

  3. [Optional] If you want to have item image in your inventory, place the image bellow here: - ox_inventory\web\images - qb-inventory\html\images - qs-inventory\html\images - ps-inventory\html\images - codem-inventory\html\itemimages - core_inventory\html\img

If you need help with anything else, do not hesitate and open a support ticket in our discord.

Last updated