Abbigliamento come oggetto (QBCore) - FiveMX

Abbigliamento come articolo (QBCore)

Questo script permette ai giocatori di utilizzare gli articoli di vestiario nel loro inventario in FiveM utilizzando il framework qbcore. Con questo script, i giocatori possono avere diversi articoli di vestiario, rubare articoli di vestiario ad altri giocatori e configurare comandi e oggetti rimovibili.

Scaricamento

Installazione dello script

  1. Posiziona il file:
    • Metti il file script nel resources cartella del tuo server FiveM.
  2. Modificare server.cfg:
    • Aggiungi la seguente riga al tuo server.cfg file per caricare lo script: copiare sqlCodestart script_name

Aggiunta di elementi

Per aggiungere nuovi capi di abbigliamento, inserisci il seguente codice nel tuo qb-coreshareditems.lua file:

-- Clothing Items<br>['torso'] = { ['name'] = 'torso', ['label'] = 'Torso', ['weight'] = 100, ['type'] = 'item', ['image'] = 'torso.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable torso item.' },<br>['tshirt'] = { ['name'] = 'tshirt', ['label'] = 'T-Shirt', ['weight'] = 100, ['type'] = 'item', ['image'] = 'tshirt.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable t-shirt item.' },<br>['arms'] = { ['name'] = 'arms', ['label'] = 'Arms', ['weight'] = 100, ['type'] = 'item', ['image'] = 'arms.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wearable arm accessories.' },<br>['jeans'] = { ['name'] = 'jeans', ['label'] = 'Jeans', ['weight'] = 100, ['type'] = 'item', ['image'] = 'jeans.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A pair of wearable jeans.' },<br>['shoes'] = { ['name'] = 'shoes', ['label'] = 'Shoes', ['weight'] = 100, ['type'] = 'item', ['image'] = 'shoes.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wearable shoes.' },<br>['bag'] = { ['name'] = 'bag', ['label'] = 'Bag', ['weight'] = 100, ['type'] = 'item', ['image'] = 'bag.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable bag accessory.' },<br>['chain'] = { ['name'] = 'chain', ['label'] = 'Chain', ['weight'] = 100, ['type'] = 'item', ['image'] = 'chain.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable chain accessory.' },<br>['mask'] = { ['name'] = 'mask', ['label'] = 'Mask', ['weight'] = 100, ['type'] = 'item', ['image'] = 'mask.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable mask.' },<br>['helmet'] = { ['name'] = 'helmet', ['label'] = 'Helmet', ['weight'] = 100, ['type'] = 'item', ['image'] = 'helmet.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable helmet.' },<br>['ears'] = { ['name'] = 'ears', ['label'] = 'Ears', ['weight'] = 100, ['type'] = 'item', ['image'] = 'ears.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wearable ear accessories.' },<br>['watches'] = { ['name'] = 'watches', ['label'] = 'Watches', ['weight'] = 100, ['type'] = 'item', ['image'] = 'watches.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wearable watches.' },<br>['glasses'] = { ['name'] = 'glasses', ['label'] = 'Glasses', ['weight'] = 100, ['type'] = 'item', ['image'] = 'glasses.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'Wearable glasses.' },<br>['bracelet'] = { ['name'] = 'bracelet', ['label'] = 'Bracelet', ['weight'] = 100, ['type'] = 'item', ['image'] = 'bracelet.png', ['unique'] = true, ['useable'] = true, ['shouldClose'] = true, ['combinable'] = nil, ['description'] = 'A wearable bracelet accessory.' },

Per visualizzare le descrizioni degli articoli, aggiungi quanto segue a qb-inventoryhtmljsapp.js o un file simile nel tuo sistema di inventario:

else if (itemData.name == "torso") {<br> $(".item-info-title").html("&lt;p&gt;" + itemData.label + "&lt;/p&gt;");<br> $(".item-info-description").html(<br> "&lt;p&gt;&lt;strong&gt;Id Clothe: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_clothe + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Id Texture: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_texture + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Description: &lt;/strong&gt;&lt;span&gt;" + itemData.info.description + "&lt;/span&gt;&lt;/p&gt;"<br> );<br>} else if (itemData.name == "tshirt") {<br> $(".item-info-title").html("&lt;p&gt;" + itemData.label + "&lt;/p&gt;");<br> $(".item-info-description").html(<br> "&lt;p&gt;&lt;strong&gt;Id Clothe: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_clothe + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Id Texture: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_texture + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Description: &lt;/strong&gt;&lt;span&gt;" + itemData.info.description + "&lt;/span&gt;&lt;/p&gt;"<br> );<br>} else if (itemData.name == "arms") {<br> $(".item-info-title").html("&lt;p&gt;" + itemData.label + "&lt;/p&gt;");<br> $(".item-info-description").html(<br> "&lt;p&gt;&lt;strong&gt;Id Clothe: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_clothe + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Id Texture: &lt;/strong&gt;&lt;span&gt;" + itemData.info.id_texture + "&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;Description: &lt;/strong&gt;&lt;span&gt;" + itemData.info.description + "&lt;/span&gt;&lt;/p&gt;"<br> );

Abbigliamento come articolo

I giocatori possono usare gli articoli di vestiario presenti nel loro inventario per cambiare istantaneamente il proprio aspetto.

Articoli di abbigliamento multipli

Trasporta più capi di abbigliamento e cambia rapidamente e facilmente i tuoi vestiti.

Furto di articoli di abbigliamento

I giocatori possono rubarsi a vicenda capi di vestiario, aumentando così l'interazione tra giocatori.

Compatibilità maschio/femmina

Supporta sia personaggi maschili che femminili con opzioni di abbigliamento appropriate.

Configurazione dei comandi

Gli amministratori possono personalizzare i comandi per equipaggiare e rimuovere gli articoli di vestiario.

Configurazione dell'elemento rimovibile

Gli amministratori possono stabilire se i capi d'abbigliamento siano rimovibili o meno, obbligando i giocatori a trovare nuovi capi per cambiare il proprio aspetto.

Lascia un commento