Sleepless-Development / sleepless_inventory_addons

GNU General Public License v3.0
38 stars 18 forks source link

Custom Config/Items [COLLABORATION] #12

Open Gameadictive opened 5 months ago

Gameadictive commented 5 months ago

--- Defines a slot with a bone, position, and rotation ---@class Slot ---@field bone number ---@field pos vector3 ---@field rot vector3

---@class OptionalVector ---@field x? number ---@field y? number ---@field z? number

--- Defines an item with properties for its placement and grouping ---@class BackItem ---@field prio number a number to define the priority of importance that the weapon should appear over others ---@field group? string which slot group the item should use. defaults to 'back' ---@field customPos? {bone?: number , pos?: OptionalVector | vector3, rot?: OptionalVector | vector3} optional custom position. required if ignorelimits is true ---@field ignoreLimits? boolean wether or not the item is attached regardless of available slots. requires a full custom position. a full custom position has a bone, pos as a vec3, and rot as a vec3 ---@field model? number | string this is required for non-weapon items. can optionally be used for weapons in order to have the attached model different than the equipped model. like if you want a sheathed katanta on your back

---@class Config ---@field defaultSlots table<string, Slot[]> ---@field BackItems table<string, BackItem>

--- Configurations for item slots and back items local Config = {}

Config.allowedVehicleClasses = { [8] = true, -- motorcycles [13] = true, -- bicycles [14] = true, -- boats }

--- Default slots configuration ---@type table<string, Slot[]> Config.defaultSlots = { ['espalda'] = { { bone = 24818, pos = vec3(0.09, -0.16, 0.12), rot = vec3(0.0, 180.0, 0.0) }, { bone = 24818, pos = vec3(0.09, -0.16, 0.00), rot = vec3(0.0, 180.0, 0.0) }, { bone = 24818, pos = vec3(0.09, -0.16, -0.12), rot = vec3(0.0, 180.0, 0.0) } }, -- ['another group'] = { -- add as many slot groups as you like for different types of items -- { bone = 24818, pos = vec3(0.09, -0.16, 0.12), rot = vec3(0.0, 180.0, 0.0) }, -- { bone = 24818, pos = vec3(0.09, -0.16, 0.00), rot = vec3(0.0, 180.0, 0.0) }, -- { bone = 24818, pos = vec3(0.09, -0.16, -0.12), rot = vec3(0.0, 180.0, 0.0) } -- }, ['musloizquierdo'] = { { bone = 58271, pos = vec3(0.09, -0.16, 0.12), rot = vec3(0.0, 180.0, 0.0) }, { bone = 58271, pos = vec3(0.09, -0.16, 0.00), rot = vec3(0.0, 180.0, 0.0) }, { bone = 58271, pos = vec3(0.09, -0.16, -0.12), rot = vec3(0.0, 180.0, 0.0) } }, ['cintura'] = { { bone = 11816, pos = vec3(0.00, 0.0, 0.0), rot = vec3(0.0, 180.0, 0.0) }, { bone = 11816, pos = vec3(0.00, 0.0, 0.0), rot = vec3(0.0, 180.0, 0.0) }, { bone = 11816, pos = vec3(0.00, 0.0, 0.0), rot = vec3(0.0, 180.0, 0.0) } }, ['musloderecho'] = { { bone = 51826, pos = vec3(0.09, -0.16, 0.12), rot = vec3(0.0, 180.0, 0.0) }, { bone = 51826, pos = vec3(0.09, -0.16, 0.00), rot = vec3(0.0, 180.0, 0.0) }, { bone = 51826, pos = vec3(0.09, -0.16, -0.12), rot = vec3(0.0, 180.0, 0.0) } }, }

--- Back items configuration --- pos x y z --- x Numeros postiviso hacia arriba del personaje, numeros negativos hacia abajo --- y Numeros positivos hacia adelante del personaje, numeros negativos hacia atrás. --- z Numeros positivos hacia la izquierda del personaje, numeros negativos hacia la derecha. --- rot x y z --- x --- y --- z

---@type table<string, BackItem> Config.BackItems = { ['WEAPON_KNIFE'] = { -- prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.3, y = 0.2 }, rot = { x = 15.0, y = 210.0, z = 90.0 } } }, ['WEAPON_NIGHTSTICK'] = { -- prio = 1, group = 'cintura', customPos = { pos = { x = -0.2, y = 0.0, z = 0.2 }, rot = { x = 90.0, y = 180.0, z = 90.0 } } }, ['WEAPON_HAMMER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BAT'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.4, y = -0.15 }, rot = { y = 270.0 } } }, ['WEAPON_GOLFCLUB'] = { prio = 2, group = 'espalda', customPos = { pos = { x = 0.4, y = -0.15 }, rot = { y = 270.0 } } }, ['WEAPON_CROWBAR'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BOTTLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_KNUCKLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_HATCHET'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MACHETE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SWITCHBLADE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_FLASHLIGHT'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.0, y = 0.0, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_PISTOL'] = { -- prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.35, y = 0.1, z = -0.229 }, rot = { x = 99.0, y = 150.0, z = 30.0 } } }, ['WEAPON_COMBATPISTOL'] = { prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.01, y = 0.1, z = 0.07 }, rot = { x = -115.0, y = 0.0, z = 0.0 } } }, ['WEAPON_APPISTOL'] = { prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.01, y = 0.1, z = 0.07 }, rot = { x = -115.0, y = 0.0, z = 0.0 } } }, ['WEAPON_PISTOL50'] = { prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.01, y = 0.1, z = 0.07 }, rot = { x = -115.0, y = 0.0, z = 0.0 } } }, ['WEAPON_VINTAGEPISTOL'] = { prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.01, y = 0.1, z = 0.07 }, rot = { x = -115.0, y = 0.0, z = 0.0 } } }, ['WEAPON_HEAVYPISTOL'] = { prio = 1, group = 'musloderecho', customPos = { pos = { x = -0.01, y = 0.1, z = 0.07 }, rot = { x = -115.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SNSPISTOL'] = { prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.01, y = 0.1, z = -0.07 }, rot = { x = -55.0, y = 0.1, z = 0.0 } } }, ['WEAPON_FLAREGUN'] = { prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.01, y = 0.1, z = -0.07 }, rot = { x = -55.0, y = 0.1, z = 0.0 } } }, ['WEAPON_MARKSMANPISTOL'] = { prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.01, y = 0.1, z = -0.07 }, rot = { x = -55.0, y = 0.1, z = 0.0 } } }, ['WEAPON_REVOLVER'] = { prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.01, y = 0.1, z = -0.07 }, rot = { x = -55.0, y = 0.1, z = 0.0 } } }, ['WEAPON_STUNGUN'] = { prio = 1, group = 'musloizquierdo', customPos = { pos = { x = -0.01, y = 0.1, z = -0.07 }, rot = { x = -55.0, y = 0.1, z = 0.0 } } }, ['WEAPON_MICROSMG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SMG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MG'] = { prio = 4, group = 'espalda' }, ['WEAPON_COMBATMG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_GUSENBERG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_COMBATPDW'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MACHINEPISTOL'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_ASSAULTSMG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MINISMG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_ASSAULTRIFLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.09, y = -0.15, z = 0.1 }, rot = { x = 10.0, y = 160.0, z = 10.0 } } }, ['WEAPON_CARBINERIFLE'] = { prio = 3, group = 'espalda', visibility = 1 }, ['WEAPON_ADVANCEDRIFLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SPECIALCARBINE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BULLPUPRIFLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_COMPACTRIFLE'] = { prio = 2, group = 'espalda' }, ['WEAPON_PUMPSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 135.0, z = 0.0 } } }, ['WEAPON_SAWNOFFSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BULLPUPSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 135.0, z = 0.0 } } }, ['WEAPON_ASSAULTSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MUSKET'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_HEAVYSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 225.0, z = 0.0 } } }, ['WEAPON_DBSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_AUTOSHOTGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = 0.15, z = 0.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SNIPERRIFLE'] = { prio = 3, group = 'espalda' }, ['WEAPON_HEAVYSNIPER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 135.0, z = 0.0 } } }, ['WEAPON_MARKSMANRIFLE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 0.1, y = -0.15, z = 0.0 }, rot = { x = 0.0, y = 135.0, z = 0.0 } } }, ['WEAPON_REMOTESNIPER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_STINGER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_GRENADELAUNCHER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_RPG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MINIGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_FIREWORK'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_RAILGUN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_HOMINGLAUNCHER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_COMPACTLAUNCHER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_STICKYBOMB'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_MOLOTOV'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_FIREEXTINGUISHER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_PETROLCAN'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_PROXMINE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SNOWBALL'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BALL'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_GRENADE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_SMOKEGRENADE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BZGAS'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_DIGISCANNER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_DAGGER'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_GARBAGEBAG'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_HANDCUFFS'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_BATTLEAXE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_PIPEBOMB'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_POOLCUE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['WEAPON_WRENCH'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['GADGET_NIGHTVISION'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } }, ['GADGET_PARACHUTE'] = { prio = 1, group = 'espalda', customPos = { pos = { x = 65536.0, y = 65536.0, z = 65536.0 }, rot = { x = 0.0, y = 0.0, z = 0.0 } } },

['cone'] = {
    prio = 1,
    ignoreLimits = true,
    model = `prop_roadcone02a`,
    customPos = {
        bone = 12844,
        pos = vec3(0.06, 0.0, 0.0),
        rot = vec3(0.0, 90.0, 0.0)
    }
}

}

return Config

Gameadictive commented 5 months ago

I will be going testing and updating the message above with your collaboration.

Demigod916 commented 5 months ago

What is this?

edit: nvm i see your other message

Gameadictive commented 5 months ago

What is this?

edit: nvm i see your other message

It´s okay if i do this here?