Coder Social home page Coder Social logo

mi-card's Introduction

mi-card

QBCore Trading Cards

Screenshots

Opening Cards Opening Cards 2 Use Card Use PSA Card


qb-core (shared.lua)

-- MI CARD
["micard_legendary"]			=  {["name"] = "micard_legendary", 				["label"] = "Legendary Card", 				["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_legendary.png", 			["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "Wow!! You have a legendary card!!"},
["micard_rare"]					=  {["name"] = "micard_rare",					["label"] = "Rare Card", 				    ["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_rare.png", 					["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "Wow!! You have a rare card!!"},
["micard_basic"]				=  {["name"] = "micard_basic",					["label"] = "Basic Card", 				    ["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_basic.png", 				["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "Phewww, just basic card"},
["micard_booster_pack1"]		=  {["name"] = "micard_booster_pack1",			["label"] = "Booster Pack", 			    ["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_booster_pack1.png", 		["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "Contains 5 cards"},
["micard_booster_pack2"]		=  {["name"] = "micard_booster_pack2",			["label"] = "Booster Pack", 				["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_booster_pack2.png", 		["unique"] = false, 	["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "Contains 10 cards"},
["micard_psa"]					=  {["name"] = "micard_psa",					["label"] = "PSA Case",		 				["weight"] = 0, 		["type"] = "item", 		["image"] = "micard_booster_pack2.png", 		["unique"] = true, 		["useable"] = true, 	["shouldClose"] = true,   ["combinable"] = nil,   ["description"] = "PSA Case"},

qb-inventory (server/main.lua), setInventoryData

elseif QBCore.Shared.SplitStr(shopType, "_")[1] == "Itemshop" then
	-- MICARD
	if itemData.name == "micard_psa" then
		local StringCharset = {}
		local NumberCharset = {}
		for i = 48,  57 do table.insert(NumberCharset, string.char(i)) end
		for i = 65,  90 do table.insert(StringCharset, string.char(i)) end
		for i = 97, 122 do table.insert(StringCharset, string.char(i)) end
		
		RandomStr = function(length)
			if length > 0 then
				return RandomStr(length-1) .. StringCharset[math.random(1, #StringCharset)]
			else
				return ''
			end
		end
		
		RandomInt = function(length)
			if length > 0 then
				return RandomInt(length-1) .. NumberCharset[math.random(1, #NumberCharset)]
			else
				return ''
			end
		end


		local psaId = tostring(RandomStr(3) .. RandomInt(2) .. RandomStr(1) .. RandomInt(2) .. RandomInt(3))
		itemData.info = {
			serial = psaId
		}
	end
	-- END MICARD

mi-card's People

Contributors

irsyadf27 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.