shop_ped_apparel.meta
INFO
Registra i vestiti nei negozi di GTA V. Senza questo file, i capi esistono nel gioco ma non sono acquistabili in nessun negozio.
| Obiettivo | Dettagli |
|---|---|
| Cosa imparerai | • Struttura completa del file shop_ped_apparel.meta • Come registrare vestiti, cappelli, pantaloni e scarpe nei negozi • Prezzi, stock e restrizioni di sesso • Collegamento con pedvariation.meta e fxmanifest |
| Prerequisiti | • Aver registrato i drawable in pedvariation.meta • Conoscenza base di XML • Una risorsa FiveM configurata |
A Cosa Serve
shop_ped_apparel.meta dice al gioco:
- Quali capi d’abbigliamento sono disponibili nei negozi
- In quali categorie di negozio appaiono (sportivo, lavoro, etc.)
- Quanto costano e quanti ne sono in magazzino
- Quali restrizioni si applicano (sesso, ped specifico)
Senza questo file, i vestiti sono accessibili solo via script (SetPedComponentVariation).
Struttura XML Completa
<?xml version="1.0" encoding="UTF-8"?>
<CShopPedApparel>
<Shops>
<!-- NEGOZIO PRINCIPALE -->
<Item>
<ShopName>clothes</ShopName>
<Categories>
<Item>
<Category>CAT_SPORT</Category>
<Items>
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>0</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>200</Price>
<Stock>999</Stock>
<PlayerRestriction>MALE</PlayerRestriction>
<LocTranslate>MAGLIETTA_SPORT_01</LocTranslate>
</Item>
</Items>
</Item>
</Categories>
</Item>
</Shops>
</CShopPedApparel>Nodo Principale: Shops
Contiene uno o più negozi. Ogni negozio ha un ShopName che corrisponde all’interno del gioco.
| ShopName | Negozio |
|---|---|
clothes | Negozio di vestiti normale (Binco, SubUrban) |
accessories | Accessori (maschere, cappelli) |
watches | Orologi |
jewelry | Gioielli |
Categories
Ogni categoria raggruppa capi simili. Le categorie più comuni:
| Categoria | Descrizione |
|---|---|
CAT_SPORT | Abbigliamento sportivo |
CAT_WORK | Abbigliamento da lavoro |
CAT_OUTDOOR | Abbigliamento outdoor |
CAT_FORMAL | Abbigliamento formale |
CAT_CASUAL | Abbigliamento casual |
CAT_SHOES | Scarpe |
CAT_HATS | Cappelli |
CAT_GLASSES | Occhiali |
CAT_WATCHES | Orologi |
CAT_ACCESSORIES | Accessori vari |
CAT_BAGS | Borse e zaini |
CAT_JEANS | Jeans |
CAT_SHIRTS | Camicie |
CAT_T_SHIRTS | Magliette |
CAT_JACKETS | Giacche |
CAT_SHORTS | Shorts |
CAT_SWIMWEAR | Costumi da bagno |
CAT_UNDERWEAR | Intimo |
CAT_MISC | Altro |
Nota: Le categorie disponibili dipendono dal negozio. Un orologio non può stare in
CAT_HATS.
Item
Ogni capo nel negozio ha questi campi:
| Campo | Obbligatorio | Descrizione |
|---|---|---|
ComponentData | ✅ | Riferimento al componente/accessorio |
Price | ✅ | Prezzo in $ |
Stock | ❌ | Quantità in magazzino (default: infinite) |
PlayerRestriction | ❌ | MALE, FEMALE o ometti per entrambi |
LocTranslate | ❌ | Chiave per traduzione nome |
ComponentData
Per componenti del corpo (vestiti):
<ComponentData>
<ComponentType>3</ComponentType> <!-- Sempre 3 per vestiti -->
<ComponentId>3</ComponentId> <!-- ID componente (0-11) -->
<DrawableIndex>0</DrawableIndex> <!-- Quale drawable -->
<TextureIndex>0</TextureIndex> <!-- Quale texture -->
</ComponentData>Per props (accessori):
<ComponentData>
<ComponentType>0</ComponentType> <!-- Sempre 0 per props -->
<ComponentId>0</ComponentId> <!-- ID prop (0-6) -->
<DrawableIndex>0</DrawableIndex> <!-- Quale prop -->
<TextureIndex>0</TextureIndex> <!-- Quale texture -->
</ComponentData>| ComponentType | Tipo |
|---|---|
3 | Componente del corpo (vestito) |
0 | Prop / Accessorio |
Price, Stock, PlayerRestriction
Price
Prezzo in dollari del gioco. Qualsiasi intero positivo:
<Price>500</Price> <!-- 500$ -->
<Price>0</Price> <!-- Gratis -->
<Price>10000</Price> <!-- Costoso -->Stock
Quantità disponibile. Quando arriva a 0, il capo non è più acquistabile (fino al reset del negozio):
<Stock>999</Stock> <!-- Quasi infinito -->
<Stock>1</Stock> <!-- Pezzo unico -->
<Stock>-1</Stock> <!-- Infinito (default se omesso) -->PlayerRestriction
Limita il capo a un sesso specifico:
| Valore | Effetto |
|---|---|
MALE | Solo personaggi maschili |
FEMALE | Solo personaggi femminili |
| (omesso) | Entrambi |
Collegamento a Pedvariation.meta
Il ComponentData in shop_ped_apparel.meta deve corrispondere esattamente a un drawable definito in pedvariation.meta.
pedvariation.meta definisce:
- Che drawables e textures esistono per un ped
shop_ped_apparel.meta definisce:
- Quali di quei drawables sono acquistabili in negozio
Esempio di corrispondenza
In pedvariation.meta:
<!-- Torso: Component 3 -->
<Item>
<ComponentId>3</ComponentId>
<Drawable>
<DrawableIndex>0</DrawableIndex> <!-- Maglietta basic -->
<TextureIndex>0</TextureIndex> <!-- Bianca -->
<TextureIndex>1</TextureIndex> <!-- Nera -->
</Drawable>
</Item>In shop_ped_apparel.meta (stesso drawable, stessa texture):
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>0</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>200</Price>
</Item>Se il drawable o texture non esiste in
pedvariation.meta, il gioco ignora l’item — senza crash ma senza apparire.
Esempio Completo: Aggiungere una Maglietta
1. In pedvariation.meta
Registra il nuovo drawable:
<Item>
<ComponentId>3</ComponentId>
<Drawable>
<DrawableIndex>5</DrawableIndex>
<TextureIndex>0</TextureIndex>
<TextureIndex>1</TextureIndex>
</Drawable>
</Item>2. In shop_ped_apparel.meta
Aggiungi al negozio:
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>5</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>350</Price>
<Stock>999</Stock>
<PlayerRestriction>MALE</PlayerRestriction>
<LocTranslate>TSHIRT_CUSTOM_01</LocTranslate>
</Item>Risultato: maglietta acquistabile a 350$, solo maschile, con scorta illimitata, nella categoria sportiva.
Esempio Cappelli, Pantaloni, Scarpe
Cappello (Prop 0)
<Category>CAT_HATS</Category>
<Item>
<ComponentData>
<ComponentType>0</ComponentType>
<ComponentId>0</ComponentId> <!-- PropID 0 = cappelli -->
<DrawableIndex>2</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>150</Price>
<Stock>999</Stock>
</Item>Pantaloni (Component 4)
<Category>CAT_JEANS</Category>
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>4</ComponentId> <!-- Gambe -->
<DrawableIndex>0</DrawableIndex>
<TextureIndex>1</TextureIndex>
</ComponentData>
<Price>400</Price>
<Stock>999</Stock>
</Item>Scarpe (Component 6)
<Category>CAT_SHOES</Category>
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>6</ComponentId> <!-- Scarpe -->
<DrawableIndex>1</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>250</Price>
<Stock>999</Stock>
</Item>Occhiali (Prop 1)
<Category>CAT_GLASSES</Category>
<Item>
<ComponentData>
<ComponentType>0</ComponentType>
<ComponentId>1</ComponentId> <!-- PropID 1 = occhiali -->
<DrawableIndex>3</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>500</Price>
<Stock>999</Stock>
</Item>Più Categorie, Stesso Categoria
Puoi avere più Item nello stesso Category:
<Categories>
<Item>
<Category>CAT_T_SHIRTS</Category>
<Items>
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>0</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>200</Price>
</Item>
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>0</DrawableIndex>
<TextureIndex>1</TextureIndex>
</ComponentData>
<Price>200</Price>
</Item>
</Items>
</Item>
</Categories>Più Negozi (componentOverrides)
Puoi creare più negozi con ShopName diversi. Per esempio, un negozio separato per accessori:
<Shops>
<!-- Negozio vestiti -->
<Item>
<ShopName>clothes</ShopName>
<Categories>
<Item>
<Category>CAT_SPORT</Category>
<Items>
<!-- ... capi sportivi ... -->
</Items>
</Item>
</Categories>
</Item>
<!-- Negozio cappelli separato -->
<Item>
<ShopName>accessories</ShopName>
<Categories>
<Item>
<Category>CAT_HATS</Category>
<Items>
<!-- ... cappelli ... -->
</Items>
</Item>
</Categories>
</Item>
</Shops>Usare un Negozio Personalizzato
Alcuni server aggiungono shop personalizzati. Il nome del negozio corrisponde alla definizione in shops.ymt. I nomi più comuni:
| ShopName | Tipo |
|---|---|
clothes | Negozio vestiti normale |
accessories | Accessori |
watches | Orologi |
jewelry | Gioielli |
masks | Maschere |
loc_translations
Per dare nomi leggibili ai capi, usa LocTranslate nel shop_ped_apparel.meta. Poi definisci la traduzione in un file di localizzazione.
In shop_ped_apparel.meta
<Item>
<ComponentData>
<ComponentType>3</ComponentType>
<ComponentId>3</ComponentId>
<DrawableIndex>0</DrawableIndex>
<TextureIndex>0</TextureIndex>
</ComponentData>
<Price>200</Price>
<LocTranslate>TSHIRT_CUSTOM_01</LocTranslate>
</Item>In un file translation (.gxt2 o nel __resource.lua)
-- gxt2 keys
AddTextEntry('TSHIRT_CUSTOM_01', 'Maglietta Personalizzata Bianca')
AddTextEntry('PANTS_CUSTOM_01', 'Jeans Personalizzati Blu')
LocTranslatenon è obbligatoria: se omessa, il gioco mostra il nome generico del componente.
fxmanifest
fx_version 'cerulean'
game 'gta5'
data_file 'SHOP_PED_APPAREL_METAFILE' 'shop_ped_apparel.meta'
-- Il file deve stare nella root della risorsa, non in stream/Il file shop_ped_apparel.meta va nella root della risorsa (non in stream/), a differenza di pedvariation.meta che va dentro stream/.
Se lo metti in
stream/, non verrà letto e i capi non appariranno in negozio.
Errori Comuni
| Errore | Causa | Soluzione |
|---|---|---|
| Il capo non appare in negozio | data_file sbagliato o file in stream/ | Metti il file nella root e usa SHOP_PED_APPAREL_METAFILE |
| Il capo appare ma è invisibile | DrawableIndex non esiste in pedvariation.meta | Controlla che il drawable sia registrato per quel ped |
| ”Out of stock” subito | Stock non impostato o male configurato | Metti Stock>999</Stock> |
| Capo non acquistabile per il personaggio | PlayerRestriction sbagliato | Controlla MALE/FEMALE o ometti per entrambi |
| Categoria vuota nel negozio | Category inesistente o errata | Usa una categoria valida (es. CAT_SPORT, non CAT_SPORTS) |
| Doppioni in vetrina | Stesso ComponentData in due Items | Ogni DrawableIndex+TextureIndex deve essere unico per negozio |
| Nomi in inglese brutti | LocTranslate non impostato | Aggiungi LocTranslate + AddTextEntry |
Riepilogo
┌─────────────────────────────┐
│ pedvariation.meta (stream/)│ ← Definisce i drawable disponibili
│ DrawableIndex 0, 1, 2... │
└──────────────┬──────────────┘
│ corrispondenza
▼
┌─────────────────────────────┐
│ shop_ped_apparel.meta (root)│ ← Rende i drawable acquistabili
│ Price, Stock, Category │
│ PlayerRestriction, LocTrans │
└─────────────────────────────┘
Prossimo passo: Torna all’Indice Generale