Links
👔

Clothing Store

Documentation relating to the kd_clothingstore.

1. Installation

kd_clothingstore works with VORP & RedEM:RP (2023 & old) frameworks.
To install kd_clothingstore:
  • Drag and drop the resource into your resources folder
    • kd_clothingstore
  • Add this ensure in your server.cfg
    • ensure kd_clothingstore
  • Be sure you remove your previous clothing store script
For RedEM:RP (old only)
You have to edit the keep the ensure of redemrp_clothing and replace it with this empty resource :
Congratulation, the Clothing Store script is ready to be used!

2. Usage

Go on the store (blip on the map) to get the prompt. Press the key to open the menu.

3. Config.lua file

Config = {}
Config.Debug = false
Config.BlipSprite = `blip_shop_tailor` -- Clothing shop sprite
Config.BlipSpriteWardrobes = `blip_shop_wardrobe`
Config.DisplayOutfitId = false -- Display the Outfit ID in the menu
Config.PercentResell = 0.33 -- Use 0 tu turn off the resell feature : 0.5 = 50% of the initial price
Config.OpenStoreNewCharacter = true -- Force to open the store for new character
Config.EnablePrompt = true -- False to disable Prompt to enter in the store
Config.ExtraLightIntensity = 10.0 -- Light added in the store to see better the character
Config.OffsetRoutingBucket = 0 --value added to the serverID of the player to define the instance ID
Config.oldVORPChar = false --(Only for VORP users) to use the C# version of VORP Character
Config.Keys = {
enter = "INPUT_FRONTEND_RB",
turn = "INPUT_CONTEXT_X",
delete = "INPUT_FRONTEND_RS",
}
Config.KeysDisabled = { --keys disabled in the sore
`INPUT_MOVE_UD`,
`INPUT_MOVE_LR`,
`INPUT_MOVE_LB`,
`INPUT_COVER`
}
Config.Stores = {
{ -- VALENTINE
book = vector4(-326.17, 773.757, 117.5, -170.0), --location of the book
fittingRoom = vector4(-329.31, 775.11, 120.63, 294.79), --location of the fitting room
pedCoords = vector4(-325.67, 772.63, 116.44, 11.3), --location of the tailor ped
pedModel = `S_M_M_Tailor_01` --model of the tailor ped
blip = true, --if the blip is displayed for this store
distancePrompt = 2.0 --distance to display the prompt
},
{ -- SAINT DENIS
book = vector4(2554.619, -1167.834, 53.746,0.0),
fittingRoom = vector4(2555.89, -1161.23, 52.6, 12.85),
pedCoords = vector4(2554.6, -1166.83, 52.7, 180.95),
pedModel = `S_M_M_Tailor_01`
},
{ -- BLACK WATER
book = vector4(-761.98,-1292.61,43.885,180.0),
fittingRoom = vector4(-767.74, -1295.17, 42.84, 304.87),
pedCoords = vector4(-761.75, -1293.92, 42.84, 357.16),
pedModel = `S_M_M_Tailor_01`
},
{ -- Tumbleweed
book = vector4(-5486.660, -2936.75, -0.346, -144.0),
fittingRoom = vector4(-5479.77, -2933.07, -1.36, 181.29),
pedCoords = false,
}
}
Config.Wardrobes = { --wardrobe locations
{
location = vector3(1223.55, -1288.67, 76.9), --location
blip = true --use false to turn off the blip
distancePrompt = 2.0, --distance to display the prompt
needInstance = false -- if an instance need to be created for this wardrobe
}
}
-- to use the gold currency, define the price like this table :
-- pants = {money = 2, gold = 4}
Config.Prices = { --Price of clothes by category
boot_accessories = 4,
pants = 2,
cloaks = 4,
hats = 2,
vests = 2,
chaps = 2,
shirts_full = 2,
badges = 10,
masks = 5,
spats = 3,
neckwear = 2,
boots = 2,
accessories = 5,
jewelry_rings_right = 10,
jewelry_rings_left = 10,
jewelry_bracelets = 6,
gauntlets = 3,
neckties = 3,
holsters_knife = 3,
talisman_holster = 3,
loadouts = 5,
suspenders = 3,
talisman_satchel = 3,
satchels = 3,
gunbelts = 3,
belts = 2,
belt_buckles = 6,
holsters_left = 5,
holsters_right = 5,
talisman_wrist = 5,
coats = 5,
coats_closed = 5,
ponchos = 3,
eyewear = 5,
gloves = 3,
holsters_crossdraw = 4,
aprons = 4,
skirts = 2,
hair_accessories = 2,
dresses = 1,
armor = 20,
}
Config.modelPrices = {} --Price for a specific model
--Init values (don't touch)
Config.modelPrices["male"] = {}
Config.modelPrices["female"] = {}
for category in pairs (Config.Prices) do
Config.modelPrices["male"][category] = {}
end
-- Structure of the table :
-- Config.modelPrices[<sexe>][<category>][<number>] = <price>
Config.modelPrices["male"]["hats"][2] = Config.Prices.hats * 1.25 --here, I define the price of the hat n°2 at 1.25% of the normal price
Config.modelPrices["male"]["hats"][3] = 2.75 -- hat n°3 at $2.75
Config.modelPrices["male"]["hats"][4] = 5.5
Config.modelPrices["male"]["hats"][5] = 4.25
Config.modelPrices["male"]["hats"][6] = Config.Prices.hats * 2 --hat n°6 at the double of classic price
--Function to buy item with gold for framework without native way to do it
Config.CanBuyWithGold = function (source,price)
return false
end

4. Custom Framework

⚠ Scripting skills are required to configure the script for custom framework ⚠
To use the script with a custom framework, you have to add some variables in the config file :
Config.Framework = "Custom" --Needed to unlock the custom framework feature
-------------------------
--- SERVER SIDE
-------------------------
--Function to get the identifier of player
[email protected] source is the serverID of the player
[email protected] array with identifier and charid key
Config.GetIdentifier = function(source)
local player = {
identifier = identifier, --the identifier of player
charid = charid --the charid of player. If not needed just use ''
}
return player
end
--Function to check if the player has enough money to buy the cloth
[email protected] source is the serverID of the player
[email protected] price is the price of the cloth
[email protected] moneyType is the devise of the price : 0 for normal & 1 for gold
[email protected] true/false to accept/deny the purchase
Config.CanBuy = function(source,price, moneyType)
return true
end
--Function to get the player's clothes
[email protected] source is the serverID of the player
--clothes is a table with clothing category in key and hash of cloth in value.
--clothes can be a json array
Config.GetClothes = function(source)
local clothes = {}
return clothes
end
--Function to get the player's skin
[email protected] source is the serverID of the player
--skin is a table with category in key and data in value.
Config.GetSkin = function(source)
local skin = {}
return skin
end
--Function fire to save the new cloth in the DB
[email protected] source is the serverID of the player
[email protected] dataPreview is a table with the new cloth data :
-- dataPreview.menu is the category of cloth
-- dataPreview.hash is the hash of cloth
Config.SaveNewCloth = function(source,dataPreview)
end
--Function fire when player select Outfit
[email protected] source is the serverID of the player
[email protected] clothes in the table with category in key and hash in value of the outfit
Config.ApplyNewOutfit = function(source,clothes)
end
--Function to send notification to player from serverside
[email protected] source is the serverID of the player
[email protected] text is the text to be sent to the player
Config.Notify = function(source, text)
end
--Function to send notification to player from serverside
[email protected] source is the serverID of the player
[email protected] amount is the amount of money to be sent to the player
Config.GiveMoney = function(source, amount)
end

5. For developers

You can open the wardrobe with this client event :
[email protected] needInstance = true/false : Define if the wardrobe need personnal instance
TriggerEvent('kd_clothingstore:openWardrobe', needInstance)
You can apply an outfit from his id to a player by trigger this server event (from client) :
TriggerServerEvent('kd_clothingstore:useOutfitId',id)
You can remove all clothes with this client event :
TriggerEvent('kd_clothingstore:removeAllClothes'
You can equip all clothes with this client event :
TriggerEvent('kd_clothingstore:resetClothes')
You can grab the closing of the menu after the ped creation with this client event :
kd_clothingstore:client:endCreation