Giter Site home page Giter Site logo

mbt_meta_clothes's Introduction

MBT Meta Clothes take advantage of ox_inventory metadata feature giving you the possibility to turn your clothes into unique items. Undress yourself using a clean and simple NUI and have fun swapping your outfits with your friends!

Dependencies:

⚠️Important:

Add to your items the following ones (customize the settings to fit your needs) DO NOT CHANGE THE ITEMS NAME!
The resource has been tested ONLY on Ox Core and ESX
Remember to check and change if needed the Default clothes in MBT.Drawables and MBT.Props

ox_inventory/data/items.lua

['topdress'] = {
		label 		= 'Top Dress',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'clothingshirt', clip = 'try_shirt_positive_d', flag = 51 },
			usetime = 1200,
		}
	},
  ['jacket'] = {
		label 		= 'Jacket',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'clothingshirt', clip = 'try_shirt_positive_d', flag = 51 },
			usetime = 1200,
		}
	},
  ['trousers'] = {
		label 		= 'Trousers',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 're@construction', clip = 'out_of_breath', flag = 51 },
			usetime = 1200,
		}
	},
  ['shoes'] = {
		label 		= 'Shoes',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'random@domestic', clip = 'pickup_low', flag = 0 },
			usetime = 1200,
		}
	},
  ['hat'] = {
		label 		= 'Hat',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'missheist_agency2ahelmet', clip = 'take_off_helmet_stand', flag = 51 },
			usetime = 1200,
		}
	},
  ['glasses'] = {
		label 		= 'Glasses',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'clothingspecs', clip = 'take_off', flag = 51 },
			usetime = 1200,
		}
	},
  ['earaccess'] = {
		label 		= 'Ear Accessories',
		description = 'YOUR_DESCRIPTION',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'mp_cp_stolen_tut', clip = 'b_think', flag = 51 },
			usetime = 1200,
		}
	},
  ['chain'] = {
		label 		= 'Torso Accessories',
		description = 'Torso Accessories',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'clothingtie', clip = 'try_tie_positive_a', flag = 51 },
			usetime = 2500,
		}
	},
  ['watch'] = {
		label 		= 'Watch',
		description = 'Watch',
		weight 		= 100,
		stack 		= true,
		close 		= true,
		client = {
			anim = { dict = 'nmt_3_rcm-10', clip = 'cs_nigel_dual-10', flag = 51 },
			usetime = 900,
		}
	},
  

ox_inventory/modules/items/client.lua

Item('topdress', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then 
    	-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]
	end

	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Drawables",
		index = slot.metadata,
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyKitDress", slot.metadata)
				end
			end)
		end
	})
end)

Item('trousers', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
	  	-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]     
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Drawables",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyDress", slot.metadata)
				end
			end)
		end
	})
end)

Item('shoes', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
		-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]    
	end
	
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Drawables",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyDress", slot.metadata)
				end
			end)
		end
	})
end)

Item('chain', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
	  	-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]     
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Props",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyProps", slot.metadata)
				end
			end)
		end
	})
end)

Item('watch', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
		-- Trigger your notify here
   		-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]   
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Props",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyProps", slot.metadata)
				end
			end)
		end
	})
end)

Item('hat', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
		-- Trigger your notify here
   		-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]   
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Props",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyProps", slot.metadata)
				end
			end)
		end
	})
end)

Item('glasses', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
		-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]      
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Props",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyProps", slot.metadata)
				end
			end)
		end
	})
end)

Item('earaccess', function(data, slot)
	local sexLabel = { ["m"] = "man", ["f"] = "woman"}
	if PlayerData.sex ~= slot.metadata.sex then
		-- Trigger your notify here
    	-- Text: This piece of clothing is not for "..sexLabel[PlayerData.sex]      
	end
  
	TriggerEvent("mbt_metaclothes:checkDress", {
		type = "Props",
		index = slot.metadata.index, 
		sex = PlayerData.sex,
		cb = function(canDress)
			if not canDress then
				-- Trigger your notify here
				return 
			end 
			
			ox_inventory:useItem(data, function(data)
				if data then
					TriggerEvent("mbt_metaclothes:applyProps", slot.metadata)
				end
			end)
		end
	})
end)


Features

  • Turn clothes into items and swap them with your friends
  • ESX compatible (Tested with ESX Legacy)
  • Ox Core compatible
  • QB Core compatible(if you have ox_inventory)
  • Optimized for low CPU usage
  • Customizable labels
  • Customizable notify system

Media:

DMCA Protection Certificate

image

Copyright © 2022 Malibú Tech. All rights reserved.

mbt_meta_clothes's People

Contributors

darkside0fthecode avatar moldrok avatar malibutechteam avatar fsgdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.