About This File
This script lets you create your own clothing shop(s) with JSON files.
Installing
- Put the files you downloaded in their respective places
- Download & install NativeUI if you haven't yet, this script needs it
- (Only if you're going to have paid items) Download & install Currency API then define a currency named cash.
- Add require('clothing-shops') to client_packages/index.js
- Set up some clothing shops (read below)
- All done
Setting Up Shops
Shop data is loaded from packages/clothing-shops/shops, any JSON file there will be treated as a clothing shop. Shop file structure:
{ // OPTIONAL, this object will be the menu banner sprite on clientside. Search for "shopui_title_" on https://wiki.rage.mp/index.php?title=Textures "bannerSprite": { "library": "shopui_title_highendfashion", "texture": "shopui_title_highendfashion" }, // REQUIRED, this array contains the shop coordinates "shops": [ { "x": 123.4, "y": 456.7, "z": 8.9 }, { "x": 10.0, "y": 20.0, "z": 30.0 } ], // REQUIRED, this object contains item data for freemode male model "male": { // REQUIRED, this object contains all clothing item data "clothes": { // REQUIRED, this array contains item data for a component slot (https://wiki.rage.mp/index.php?title=Clothes - we're using 11 - tops here) "11": [ // REQUIRED, item object(s) for component slot 11 { "name": "Blue Burger Shot Hockey Shirt", "drawable": 282, "texture": 0 }, // This item will need the player to have some money (handled with Currency API) { "name": "Blue Cluckin' Bell Hockey Shirt", "drawable": 282, "texture": 4, "price": 500 } ] }, // REQUIRED, this property contains all prop item data (we're not gonna add any props to freemode male here, so it's just an empty object) "props": {} }, // REQUIRED, this object contains item data for freemode female model "female": { // This time we're not adding any clothes "clothes": {}, // But we're adding props "props": { // Same as above, prop slot as key (we're using 7 - bracelets) "7": [ // Prop items are defined just like clothing items { "name": "Gold Snake Cuff", "drawable": 0, "texture": 0, "price": 200 }, { "name": "Light Wrist Chain (R)", "drawable": 7, "texture": 0 }, { "name": "Spiked Gauntlet (R)", "drawable": 13, "texture": 0, "price": 85 } ] } } }
If this wasn't any clear, there is a file named ExampleShopFile.json inside packages/clothing-shops/. (it's the file used in the preview video, put it to shops folder if you want to load it)
I'd also recommend you to check out my "Clothing Names" resource for valid names.
Source code is available on GitHub in case you don't want to download: https://github.com/root-cause/ragemp-clothing-shops