Kad Darem Docs
Search
⌃K
Links
🎩

Clothes Wheel

Documentation relating to the kd_clotheswheel.
​

1. Installation

  • kd_clotheswheel works with VORPcore, RedEM:RP and QBR. Be sure you installed one of these frameworks. For custom framework, please read the #4
  • Drag and drop the resource in your resources folder
    • kd_clotheswheel
  • Add this ensure in your server.cfg
    • ensure kd_clotheswheel
  • Select your framework on the config.lua file
  • Congratulation, the Clothes Wheel script is ready to be use !

2. Usage

The script will automatically detect what clothes you wear to only display them. By default, press the key 2 to open the wheel.
You can also open the wheel from other resource by using the client side event :
TriggerEvent('kd_clotheswheel:Open')
For shirt and neckwear, you have the possibility to put them up/down too.
​

3. Config.lua file

Config = {}
-- Turn it to true if you want to be able to restart the script whitout restart your server
Config.Debug = false
-- Key to open the wheel (https://www.rdr2mods.com/forums/topic/1575-list-of-keyboard-enums/)
Config.OpenKey = GetHashKey('INPUT_EMOTE_TWIRL_GUN_VAR_A')
-- Turn it to false if you don't want play animation when you remove clothes
Config.PlayAnim = true
-- Select your framework : "RedEM", "VORP", "QBR", "Custom"
Config.Framework = "RedEM"
​
-- Configuration of the menu
Config.Menus = {
style = { -- Style of the wheel
sizePx = 800, -- Wheel size in pixels
slices = { -- Slice style settings
hover = { ['fill'] = '#ff0000', ['opacity'] = 0.90 },
selected = { ['fill'] = '#ff0000', ['opacity'] = 0.80 }
},
titles = { -- Text style settings if image not available
default = { ['fill'] = '#ffffff', ['stroke'] = 'none', ['font-size'] = 16, ['font-weight'] = 'bold' },
hover = { ['fill'] = '#ffffff', ['stroke'] = 'none', ['font-size'] = 16, ['font-weight'] = 'bold' },
selected = { ['fill'] = '#ffffff', ['stroke'] = 'none', ['font-size'] = 16, ['font-weight'] = 'bold' }
},
icons = { -- Icon size in pixels
width = 100,
height = 100
}
},
wheels = { -- Array of wheels to display
{ -- Main wheel
navAngle = 270, -- Oritentation of wheel
minRadiusPercent = 0.5, -- Minimum radius of wheel in percentage
maxRadiusPercent = 0.8, -- Maximum radius of wheel in percentage
labels = {},
},
{ -- Wheel for sleeve
minRadiusPercent = 0.8,
maxRadiusPercent = 1.0,
labels = {}
},
{ -- Wheel for shirt
minRadiusPercent = 0.8,
maxRadiusPercent = 1.0,
labels = {}
}
}
}
​
-- Turn to false is you want to remove the possibility to unwear clothes
Config.Clothes = {
["gunbelts"] = true,
["spats"] = true,
["gloves"] = true,
["satchels"] = true,
["belts"] = true,
["dresses"] = true,
["hats"] = true,
["boots"] = true,
["vests"] = true,
["chaps"] = true,
["boot_accessories"] = true,
["coats_closed"] = true,
["armor"] = true,
["jewelry_bracelets"] = true,
["ponchos"] = true,
["holsters_left"] = true,
["jewelry_rings_left"] = true,
["cloaks"] = true,
["neckwear"] = true,
["neckties"] = true,
["pants"] = true,
["loadouts"] = true,
["coats"] = true,
["masks"] = true,
["jewelry_rings_right"] = true,
["accessories"] = true,
["suspenders"] = true,
["belt_buckles"] = true,
["shirts_full"] = true,
["eyewear"] = true,
["gauntlets"] = true,
["badges"] = true,
["name"] = false
}
​
-- function to play animation
function PlayAnimation(category)
if not Config.PlayAnim then return end
local dict = "" --animation dictionary
local anim = "" --animation name
local timer = 0 --duration before remove the cloth
local offset = 0.0 --offset of the animation
local flag = 0 --flag of animation
local flagtop = 24 --flag to play only top animation
​
if category == "gunbelts" then
if not Clothes[category].active then
flag = flagtop
anim = "respawn_action"
timer = 1000
end
elseif category == "spats" then
elseif category == "gloves" then
if not Clothes[category].active then
flag = flagtop
anim = "gloves_b"
timer = 500
end
elseif category == "satchels" then
elseif category == "belts" then
elseif category == "dresses" then
elseif category == "hats" then
dict = "[email protected]_grnd"
anim = "getup_v1_player"
offset = 0.6
timer = 900
flag = flagtop
if not Clothes[category].active then
timer = 800
end
elseif category == "boots" then
anim = "respawn_action"
timer = 500
elseif category == "vests" then
elseif category == "chaps" then
elseif category == "boot_accessories" then
elseif category == "coats_closed" then
elseif category == "armor" then
elseif category == "jewelry_bracelets" then
elseif category == "ponchos" then
elseif category == "holsters_left" then
elseif category == "jewelry_rings_left" then
elseif category == "cloaks" then
elseif category == "neckwear" then
dict = "[email protected]@bandana"
flag = flagtop
if Clothes[category].active then
anim = "neck_2_satchel"
timer = 1000
else
anim = "satchel_2_neck"
timer = 2000
end
elseif category == "neckties" then
elseif category == "pants" then
elseif category == "loadouts" then
elseif category == "coats" then
elseif category == "masks" then
dict = "[email protected]@mask"
flag = flagtop
if Clothes[category].active then
anim = "face_2_satchel"
timer = 1000
else
anim = "satchel_2_face"
timer = 2000
end
elseif category == "jewelry_rings_right" then
elseif category == "accessories" then
elseif category == "suspenders" then
elseif category == "belt_buckles" then
elseif category == "shirts_full" then
elseif category == "eyewear" then
flag = flagtop
anim = "wipe_eyes_02"
timer = 1000
elseif category == "gauntlets" then
elseif category == "badges" then
end
​
if (dict == "") then return end
​
RequestAnimDict(dict)
while not HasAnimDictLoaded(dict) do
Wait(0)
end
TaskPlayAnim(PlayerPedId(), dict, anim, 4.0, -4.0, -1, flag, offset, false, false, false)
Wait(timer)
end

Custom Frameworks

It's possible to force the reload of the clothes equiped by using this client event :
​
--Event to send custom data
[email protected] category : category of clothes you need to reload. Set nil to reload all clothes
TriggerClientEvent('kd_clotheswheel:updateClothes',source,category)