Clothing Shops 1.0.0

   (6 reviews)
Sign in to follow this  

1 Screenshot

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

  • Like 3



User Feedback

Recommended Comments

For MoneyAPI Support Replace This

 

    if (Number.isInteger(item.price)) {
        // Currency API is needed for this
        if (player.data.customMoney < item.price) {
            player.notify("You can't afford this item.");
            return;
        }
        player.data.customMoney -= item.price;
        giveClothingToPlayer(player, item.name, type, slot, item.drawable, item.texture);
    } else {
        giveClothingToPlayer(player, item.name, type, slot, item.drawable, item.texture);
    }
});

2819443538.png

Share this comment


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.