<commit_before>wGeneralshop, iClothesPreview  = nil

items = nil

tGShopItemTypeTab = {}
gGShopItemTypeGrid = {}
gcGShopItemTypeColumnName = {}
gcGShopItemTypeColumnDesc = {}
gcGShopItemTypeColumnPrice = {}

grGShopItemTypeRow = {{ },{}}

--- clothe shop skins
blackMales = {7, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 28, 35, 36, 50, 51, 66, 67, 78, 79, 80, 83, 84, 102, 103, 104, 105, 106, 107, 134, 136, 142, 143, 144, 156, 163, 166, 168, 176, 180, 182, 183, 185, 220, 221, 222, 249, 253, 260, 262 }
whiteMales = {23, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 58, 59, 60, 61, 62, 68, 70, 72, 73, 78, 81, 82, 94, 95, 96, 97, 98, 99, 100, 101, 108, 109, 110, 111, 112, 113, 114, 115, 116, 120, 121, 122, 124, 127, 128, 132, 133, 135, 137, 146, 147, 153, 154, 155, 158, 159, 160, 161, 162, 164, 165, 170, 171, 173, 174, 175, 177, 179, 181, 184, 186, 187, 188, 189, 200, 202, 204, 206, 209, 212, 213, 217, 223, 230, 234, 235, 236, 240, 241, 242, 247, 248, 250, 252, 254, 255, 258, 259, 261, 264 }
asianMales = {49, 57, 58, 59, 60, 117, 118, 120, 121, 122, 123, 170, 186, 187, 203, 210, 227, 228, 229}
blackFemales = {9, 10, 11, 12, 13, 40, 41, 63, 64, 69, 76, 91, 139, 148, 190, 195, 207, 215, 218, 219, 238, 243, 244, 245, 256 }
whiteFemales = {12, 31, 38, 39, 40, 41, 53, 54, 55, 56, 64, 75, 77, 85, 86, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 140, 145, 150, 151, 152, 157, 172, 178, 192, 193, 194, 196, 197, 198, 199, 201, 205, 211, 214, 216, 224, 225, 226, 231, 232, 233, 237, 243, 246, 251, 257, 263 }
asianFemales = {38, 53, 54, 55, 56, 88, 141, 169, 178, 224, 225, 226, 263}
local fittingskins = {[0] = {[0] = blackMales, [1] = whiteMales, [2] = asianMales}, [1] = {[0] = blackFemales, [1] = whiteFemales, [2] = asianFemales}}
local availableskins = {}

-- these are all the skins
skins = { 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 263, 264 }

function resourceStart(res)
	guiSetInputEnabled(false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), resourceStart)


function showGeneralshopUI(shop_type, race, gender)
	if (wGeneralshop==nil) then
		local screenwidth, screenheight = guiGetScreenSize ()
		
		local Width = 500
		local Height = 350
		local X = (screenwidth - Width)/2
		local Y = (screenheight - Height)/2
		
		local shopTypeName = getShopTypeName(shop_type)
		local ShopTabTitles = getShopTabTitles(shop_type)
		local imageName = getImageName(shop_type)
		local introMessage = getIntroMessage(shop_type)
		
		wGeneralshop = guiCreateWindow ( X , Y , Width , Height ,  shopTypeName, false )

		lInstruction = guiCreateLabel ( 0, 20, 500, 15, "Double click on an item to buy it.", false, wGeneralshop )
		guiLabelSetHorizontalAlign ( lInstruction,"center" )
		
		lIntro = guiCreateLabel ( 0, 40, 500, 15,introMessage, false, wGeneralshop )
		guiLabelSetHorizontalAlign ( lIntro,"center" )
		guiBringToFront (lIntro)
		guiSetFont ( lIntro, "default-bold-small" )
		
		iImage =  guiCreateStaticImage ( 400, 20, 90, 80,"images/"..imageName, false,wGeneralshop )

		
		tGShopItemType = guiCreateTabPanel ( 15, 60, 470, 240, false,wGeneralshop )
		
		items = getItemsForSale(shop_type, race, gender)
		
		-- loop through each heading
		for i = 1, #ShopTabTitles do
			tGShopItemTypeTab[i] = guiCreateTab (ShopTabTitles[i], tGShopItemType)
			gGShopItemTypeGrid[i] =  guiCreateGridList ( 0.02, 0.05, 0.96, 0.9, true, tGShopItemTypeTab[i])
			gcGShopItemTypeColumnName[i] = guiGridListAddColumn (gGShopItemTypeGrid[i],"Name", 0.25)
			gcGShopItemTypeColumnPrice[i] = guiGridListAddColumn (gGShopItemTypeGrid[i] ,"Price", 0.1)
			gcGShopItemTypeColumnDesc[i] = guiGridListAddColumn (gGShopItemTypeGrid[i] ,"Description", 0.62)
					
			for y = 1, #items do

				if(items[y][6] == i) then
					grGShopItemTypeRow[i][y] = guiGridListAddRow (gGShopItemTypeGrid[i]  )
					guiGridListSetItemText ( gGShopItemTypeGrid[i]  , grGShopItemTypeRow[i][y] , gcGShopItemTypeColumnName[i] ,items[y][1], false, false )
					guiGridListSetItemText ( gGShopItemTypeGrid[i] , grGShopItemTypeRow[i][y] ,gcGShopItemTypeColumnPrice[i], "$"..items[y][3], false, false )
					guiGridListSetItemText ( gGShopItemTypeGrid[i] , grGShopItemTypeRow[i][y], gcGShopItemTypeColumnDesc[i] ,items[y][2], false, false)
				end
			end
		end
		
		guiSetInputEnabled(true)
		guiSetVisible(wGeneralshop, true)
		
		bClose = guiCreateButton(200, 315, 100, 25, "Close", false, wGeneralshop)
		addEventHandler("onClientGUIClick", bClose, hideGeneralshopUI)
		
		addEventHandler("onClientGUIDoubleClick", getRootElement(), getShopSelectedItem)
			
		-- if player has clicked to see a skin preview
		addEventHandler ( "onClientGUIClick", getRootElement(), function (button, state)
			if(button == "left") then
				
				if(iClothesPreview) then
					destroyElement(iClothesPreview )
					iClothesPreview = nil
				end
				
				if(shop_type == 5) then
					if(source == gGShopItemTypeGrid[1]) then
						if(guiGetVisible(wGeneralshop)) then
							
							-- get the selected row
							local row, column = nil
					
							local row_temp, column_temp = guiGridListGetSelectedItem ( source )
					
							if((row == nil) and (row_temp)) then
								row = row_temp
								column = column_temp
													
								local skin = tonumber(availableskins[row+1] )
								
								if(skin<10) then
									skin = tostring("00"..skin)
								elseif(skin < 100) then
									skin = tostring("0"..skin)
								else
									skin = tostring(skin)
								end
								
								iClothesPreview = guiCreateStaticImage ( 320, 20, 100, 100, ":account-system/img/" .. skin..".png" , false , gGShopItemTypeGrid[1], accountRes)
							end		
						end
					end
				end
			end
		end)
	end
end

addEvent("showGeneralshopUI", true )
addEventHandler("showGeneralshopUI", getRootElement(), showGeneralshopUI)

function hideGeneralshopUI()
	if (source==bClose) then
		guiSetInputEnabled(false)
		showCursor(false)
		guiSetVisible(wGeneralshop, false)
		destroyElement(wGeneralshop)
		wGeneralshop = nil
		removeEventHandler ("onClientGUIDoubleClick",  getRootElement(), getShopSelectedItem )
	end
end



-- function gets the shop name,
function  getShopTypeName(shop_type)

	if(shop_type == 1) then
		return "General Store"
	elseif(shop_type == 2) then
		return "Gun and Ammo Store"
	elseif(shop_type == 3) then
		return "Food store"
	elseif(shop_type == 4) then
		return "Sex Shop"
	elseif(shop_type == 5) then
		return "Clothes Shop"
	elseif(shop_type == 6) then
		return "Gym"
	elseif(shop_type == 7) then
		return "Drug Closet"
	elseif(shop_type == 8) then
		return "Electronics Store"
	elseif(shop_type == 9) then
		return "Alcohol Store"
	else
		return "This isn't a shop. Go Away."
	end
end


function getShopTabTitles(shop_type)
	
	if(shop_type == 1) then
		return {"General Items", "Consumable"}
	elseif(shop_type == 2) then
		return {"Guns"}
	elseif(shop_type == 3) then
		return {"Food","Drink"}
	elseif(shop_type == 4) then
		return {"Sexy"}
	elseif(shop_type == 5) then
		return {"Clothes"}
	elseif(shop_type == 6) then
		return {"Fighting Styles"}
	elseif(shop_type == 7) then
		return {"Chemicals"}
	elseif(shop_type == 8) then
		return {"Electronics"}
	elseif(shop_type == 9) then
		return { "Alcohol" }
	else
		return "This isn't a shop. Go Away."
	end


end


function getItemsForSale(shop_type, race, gender)

	local item = {}
	-- { Name, Description, Price, item_id, value, heading, isWeapon, suppliesCost }

	-- general store
	if(shop_type == 1) then
		
		-- General Items
		item[1] = {"Flowers", "A bouquet of lovely flowers.", "5", 14, 1,1, true,2}
		item[2] = {"Phonebook", "A large phonebook of everyones phone numbers.", "30", 7, 1,1,false,20}
		item[3] = {"Dice", "A black dice with white dots, perfect for gambling.", "2", 10, 1,1,false,1}
		item[4] = {"Golf Club", "Perfect golf club for hitting that hole-in-one.", "60", 2, 1,1,true,30}
		item[5] = {"Knife", "You're only going to use this in the kitchen, right?", "50", 4,  1,1,true,40}
		item[6] = {"Baseball Bat", "Hit a home run with this.", "60", 5, 1,1,true,40}
		item[7] = {"Shovel", "Perfect tool to dig a hole.", "40", 6, 1,1,true,20}
		item[8] = {"Pool Cue", "For that game of pub pool.", "35", 7, 1,1,true,15}
		item[9] = {"Cane", "A stick has never been so classy.", "65", 15, 1,1,true,35}
		item[10] = {"Fire Extinguisher", "There is never one of these around when there is a fire", "50", 42, 500, 1,true,25}
		item[11] = {"Spray Can", "Hey, you better not tag with this punk!", "50", 41, 500, 1,true,35}
		item[12] = {"City Guide", "A small city guide booklet.", "15", 18, 1,1,false,7}
		item[13] = {"Rope", "A long rope.", "15", 46, 1,1,false,2}
		item[14] = {"Backpack", "A reasonably sized backpack.", "30", 48, 1,1,false,2}
		item[15] = {"Fishing Rod", "A 7 foot carbon steel fishing rod.", "300", 49, 1,1,false, 175}
		item[16] = {"Mask", "A comical mask.", "20", 56, 1, 1, false, 5}
		item[17] = {"Fuel Can", "A small metal fuel canister.", "35", 57, 1, 1, false, 5}

		


		-- Consumable
		item[17] = {"Sandwich", "A yummy sandwich with cheese.", "8", 8, 1,2,false,4}
		item[18] = {"Softdrink", "A can of coca cola.", "7", 9, 1,2,false,3}
		
	-- gun shop
	elseif(shop_type == 2) then
	
		-- guns --
		item[1] = {"Brass Knuckles","A pair of brass knuckles, ouch.", "100", 1, 1, 1,true,50}
		item[2] = {"9mm Pistol", "A silver, 9mm handgun, comes with 100 ammo.", "250",  22, 100, 1,true,200}
		item[3] = {"Shotgun", "A silver shotgun - comes with 30 ammo.", "450", 25, 30, 1,true,400}
		--item[5] = {"Uzi", "A small micro-uzi - comes with 250 ammo.", "450", 28, 250, 1,true,190}
		--item[6] = {"Tec-9", "A Tec-9 micro-uzi - comes with 250 ammo", "500", 32, 250, 1,true,300}
		item[4] = {"Country Rifle", "A country rifle - comes with 30 ammo", "750", 33, 30, 1,true,600}
		item[5] = {"Body Armor", "Kevlar Body armor", "500", 999, 0, 1,true,600}
		item[6] = {"Handcuffs", "A metal pair of handcuffs.", "90", 45, 1,1,false,2}
	
	-- food + drink
	elseif(shop_type == 3) then
	
		item[1] = {"Sandwich", "A yummy sandwich with cheese", "5", 8, 1, 1, false,4}
		item[2] = {"Taco", "A greasy mexican taco", "7", 11, 1, 1, false,3}
		item[3] = {"Burger", "A double cheeseburger with bacon", "6", 12, 1, 1, false,2}
		item[4] = {"Donut", "Hot sticky sugar covered donut", "3", 13, 1, 1, false,1}
		item[5] = {"Cookie", "A luxuty chocolate chip cookie", "3", 14, 1, 1, false,1}
		item[6] = {"Haggis", "Freshly imported from Scotland", "5", 1, 1, 1, false,1}
		
		
		-- drinks
		item[7] = {"Softdrink", "A cold can of coca cola.", "2", 9, 1, 2, false,3}
		item[8] = {"Water", "A bottle of mineral water.", "1", 15, 1, 2, false,1}
	
	-- sex shop
	elseif(shop_type == 4) then
	
		-- sexy
		item[1] = {"Long Purple Dildo","A very large purple dildo", "20", 10, 1, 1, true,10}
		item[2] = {"Short Tan Dildo","A small tan dildo.", "15", 11, 1, 1, true,7}
		item[3] = {"Vibrator","A vibrator, what more needs to be said?", "25", 12, 1, 1, true,12}
		item[4] = {"Flowers","A bouquet of lovely flowers.", "5", 14, 1, 1, true,2}
	
	elseif(shop_type == 5) then
		availableskins = fittingskins[gender][race]
		for i = 1, #availableskins do
			item[i] = {"Skin "..availableskins[i] , "MTA Skin id "..availableskins[i]..".", "50", 92, availableskins[i], 1}
		end
	
	-- gym
	elseif(shop_type == 6) then
	
		item[1] = {"Standard Combat","Standard everyday fighting.", "10", 4, -1, 1, true}
		item[2] = {"Boxing","<NAME>, on drugs.", "50", 5, -1, 1, true}
		item[3] = {"<NAME>","I know kung-fu, so can you.", "50", 6, -1, 1, true}
		item[4] = {"Knee Head","Ever had a knee to the head? Pretty sore.", "50", 7, -1, 1, true}
		item[5] = {"Grab & Kick","Kick his 'ead in!", "50", 15, -1, 1, true}
		item[6] = {"Elbows","You may look retarded, but you will kick his ass!", "50", 16, -1, 1, true}
		
	-- drugs/chemicals
	elseif(shop_type == 7) then
	
		item[1] = {"<NAME>","A chemical used to make drugs.", "0", 30, 1, 1, false,0}
		item[2] = {"<NAME>","A chemical used to make drugs.", "0", 31, 1, 1, false,0}
		item[3] = {"Lysergic Acid","A chemical used to make drugs.", "0", 32, 1, 1, false,0}
		item[4] = {"Unprocessed PCP","A chemical used to make drugs.", "0", 33, 1, 1, false,0}
		
	-- electronics
	elseif(shop_type == 8) then
		item[1] = {"Ghettoblaster","A black ghettoblaster.", "250", 54, 1, 1, false,10}
		item[2] = {"Katana", "Your favourite Japanese sword.", "2000", 8, 1, 1,true,100}
		item[3] = {"Camera", "A small black analogue camera.", "75", 43, 25,1,true, 30}
		item[4] = {"Cellphone", "A stylish, slim cell phone.", "75", 2, 1,1,false,50}
		item[5] = {"Radio", "A black radio.", "50", 6, 1,1,false,30}
		item[6] = {"Watch", "Telling the time was never so sexy!", "25", 17, 1, 1,false,10}
		item[7] = {"MP3 Player", "A white, sleek looking MP3 Player. The brand reads EyePod.", "120", 19, 1,1,false,7}
		item[8] = {"Chemistry Set", "A small chemistry set.", "2000", 44, 1,1,false,15}
		item[9] = {"Safe", "A Safe to store your items in.", "300", 60, 1,1,false,0}

		
	-- alcohol shop
	elseif(shop_type == 9) then
		item[1] = {"Ziebrand Beer","The finest beer, imported from Holland.", "10", 58, 1, 1, false, 2}
	end
		<commit_msg>0000813: Fuel can item not in 24/7<commit_after>wGeneralshop, iClothesPreview  = nil

items = nil

tGShopItemTypeTab = {}
gGShopItemTypeGrid = {}
gcGShopItemTypeColumnName = {}
gcGShopItemTypeColumnDesc = {}
gcGShopItemTypeColumnPrice = {}

grGShopItemTypeRow = {{ },{}}

--- clothe shop skins
blackMales = {7, 14, 15, 16, 17, 18, 20, 21, 22, 24, 25, 28, 35, 36, 50, 51, 66, 67, 78, 79, 80, 83, 84, 102, 103, 104, 105, 106, 107, 134, 136, 142, 143, 144, 156, 163, 166, 168, 176, 180, 182, 183, 185, 220, 221, 222, 249, 253, 260, 262 }
whiteMales = {23, 26, 27, 29, 30, 32, 33, 34, 35, 36, 37, 38, 43, 44, 45, 46, 47, 48, 50, 51, 52, 53, 58, 59, 60, 61, 62, 68, 70, 72, 73, 78, 81, 82, 94, 95, 96, 97, 98, 99, 100, 101, 108, 109, 110, 111, 112, 113, 114, 115, 116, 120, 121, 122, 124, 127, 128, 132, 133, 135, 137, 146, 147, 153, 154, 155, 158, 159, 160, 161, 162, 164, 165, 170, 171, 173, 174, 175, 177, 179, 181, 184, 186, 187, 188, 189, 200, 202, 204, 206, 209, 212, 213, 217, 223, 230, 234, 235, 236, 240, 241, 242, 247, 248, 250, 252, 254, 255, 258, 259, 261, 264 }
asianMales = {49, 57, 58, 59, 60, 117, 118, 120, 121, 122, 123, 170, 186, 187, 203, 210, 227, 228, 229}
blackFemales = {9, 10, 11, 12, 13, 40, 41, 63, 64, 69, 76, 91, 139, 148, 190, 195, 207, 215, 218, 219, 238, 243, 244, 245, 256 }
whiteFemales = {12, 31, 38, 39, 40, 41, 53, 54, 55, 56, 64, 75, 77, 85, 86, 87, 88, 89, 90, 91, 92, 93, 129, 130, 131, 138, 140, 145, 150, 151, 152, 157, 172, 178, 192, 193, 194, 196, 197, 198, 199, 201, 205, 211, 214, 216, 224, 225, 226, 231, 232, 233, 237, 243, 246, 251, 257, 263 }
asianFemales = {38, 53, 54, 55, 56, 88, 141, 169, 178, 224, 225, 226, 263}
local fittingskins = {[0] = {[0] = blackMales, [1] = whiteMales, [2] = asianMales}, [1] = {[0] = blackFemales, [1] = whiteFemales, [2] = asianFemales}}
local availableskins = {}

-- these are all the skins
skins = { 7, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 66, 67, 68, 69, 72, 73, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 168, 169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 178, 179, 180, 181, 182, 183, 184, 185, 186, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 263, 264 }

function resourceStart(res)
	guiSetInputEnabled(false)
end
addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), resourceStart)


function showGeneralshopUI(shop_type, race, gender)
	if (wGeneralshop==nil) then
		local screenwidth, screenheight = guiGetScreenSize ()
		
		local Width = 500
		local Height = 350
		local X = (screenwidth - Width)/2
		local Y = (screenheight - Height)/2
		
		local shopTypeName = getShopTypeName(shop_type)
		local ShopTabTitles = getShopTabTitles(shop_type)
		local imageName = getImageName(shop_type)
		local introMessage = getIntroMessage(shop_type)
		
		wGeneralshop = guiCreateWindow ( X , Y , Width , Height ,  shopTypeName, false )

		lInstruction = guiCreateLabel ( 0, 20, 500, 15, "Double click on an item to buy it.", false, wGeneralshop )
		guiLabelSetHorizontalAlign ( lInstruction,"center" )
		
		lIntro = guiCreateLabel ( 0, 40, 500, 15,introMessage, false, wGeneralshop )
		guiLabelSetHorizontalAlign ( lIntro,"center" )
		guiBringToFront (lIntro)
		guiSetFont ( lIntro, "default-bold-small" )
		
		iImage =  guiCreateStaticImage ( 400, 20, 90, 80,"images/"..imageName, false,wGeneralshop )

		
		tGShopItemType = guiCreateTabPanel ( 15, 60, 470, 240, false,wGeneralshop )
		
		items = getItemsForSale(shop_type, race, gender)
		
		-- loop through each heading
		for i = 1, #ShopTabTitles do
			tGShopItemTypeTab[i] = guiCreateTab (ShopTabTitles[i], tGShopItemType)
			gGShopItemTypeGrid[i] =  guiCreateGridList ( 0.02, 0.05, 0.96, 0.9, true, tGShopItemTypeTab[i])
			gcGShopItemTypeColumnName[i] = guiGridListAddColumn (gGShopItemTypeGrid[i],"Name", 0.25)
			gcGShopItemTypeColumnPrice[i] = guiGridListAddColumn (gGShopItemTypeGrid[i] ,"Price", 0.1)
			gcGShopItemTypeColumnDesc[i] = guiGridListAddColumn (gGShopItemTypeGrid[i] ,"Description", 0.62)
					
			for y = 1, #items do

				if(items[y][6] == i) then
					grGShopItemTypeRow[i][y] = guiGridListAddRow (gGShopItemTypeGrid[i]  )
					guiGridListSetItemText ( gGShopItemTypeGrid[i]  , grGShopItemTypeRow[i][y] , gcGShopItemTypeColumnName[i] ,items[y][1], false, false )
					guiGridListSetItemText ( gGShopItemTypeGrid[i] , grGShopItemTypeRow[i][y] ,gcGShopItemTypeColumnPrice[i], "$"..items[y][3], false, false )
					guiGridListSetItemText ( gGShopItemTypeGrid[i] , grGShopItemTypeRow[i][y], gcGShopItemTypeColumnDesc[i] ,items[y][2], false, false)
				end
			end
		end
		
		guiSetInputEnabled(true)
		guiSetVisible(wGeneralshop, true)
		
		bClose = guiCreateButton(200, 315, 100, 25, "Close", false, wGeneralshop)
		addEventHandler("onClientGUIClick", bClose, hideGeneralshopUI)
		
		addEventHandler("onClientGUIDoubleClick", getRootElement(), getShopSelectedItem)
			
		-- if player has clicked to see a skin preview
		addEventHandler ( "onClientGUIClick", getRootElement(), function (button, state)
			if(button == "left") then
				
				if(iClothesPreview) then
					destroyElement(iClothesPreview )
					iClothesPreview = nil
				end
				
				if(shop_type == 5) then
					if(source == gGShopItemTypeGrid[1]) then
						if(guiGetVisible(wGeneralshop)) then
							
							-- get the selected row
							local row, column = nil
					
							local row_temp, column_temp = guiGridListGetSelectedItem ( source )
					
							if((row == nil) and (row_temp)) then
								row = row_temp
								column = column_temp
													
								local skin = tonumber(availableskins[row+1] )
								
								if(skin<10) then
									skin = tostring("00"..skin)
								elseif(skin < 100) then
									skin = tostring("0"..skin)
								else
									skin = tostring(skin)
								end
								
								iClothesPreview = guiCreateStaticImage ( 320, 20, 100, 100, ":account-system/img/" .. skin..".png" , false , gGShopItemTypeGrid[1], accountRes)
							end		
						end
					end
				end
			end
		end)
	end
end

addEvent("showGeneralshopUI", true )
addEventHandler("showGeneralshopUI", getRootElement(), showGeneralshopUI)

function hideGeneralshopUI()
	if (source==bClose) then
		guiSetInputEnabled(false)
		showCursor(false)
		guiSetVisible(wGeneralshop, false)
		destroyElement(wGeneralshop)
		wGeneralshop = nil
		removeEventHandler ("onClientGUIDoubleClick",  getRootElement(), getShopSelectedItem )
	end
end



-- function gets the shop name,
function  getShopTypeName(shop_type)

	if(shop_type == 1) then
		return "General Store"
	elseif(shop_type == 2) then
		return "Gun and Ammo Store"
	elseif(shop_type == 3) then
		return "Food store"
	elseif(shop_type == 4) then
		return "Sex Shop"
	elseif(shop_type == 5) then
		return "Clothes Shop"
	elseif(shop_type == 6) then
		return "Gym"
	elseif(shop_type == 7) then
		return "Drug Closet"
	elseif(shop_type == 8) then
		return "Electronics Store"
	elseif(shop_type == 9) then
		return "Alcohol Store"
	else
		return "This isn't a shop. Go Away."
	end
end


function getShopTabTitles(shop_type)
	
	if(shop_type == 1) then
		return {"General Items", "Consumable"}
	elseif(shop_type == 2) then
		return {"Guns"}
	elseif(shop_type == 3) then
		return {"Food","Drink"}
	elseif(shop_type == 4) then
		return {"Sexy"}
	elseif(shop_type == 5) then
		return {"Clothes"}
	elseif(shop_type == 6) then
		return {"Fighting Styles"}
	elseif(shop_type == 7) then
		return {"Chemicals"}
	elseif(shop_type == 8) then
		return {"Electronics"}
	elseif(shop_type == 9) then
		return { "Alcohol" }
	else
		return "This isn't a shop. Go Away."
	end


end


function getItemsForSale(shop_type, race, gender)

	local item = {}
	-- { Name, Description, Price, item_id, value, heading, isWeapon, suppliesCost }

	-- general store
	if(shop_type == 1) then
		item = {
		-- General Items
			{"Flowers", "A bouquet of lovely flowers.", "5", 14, 1,1, true,2},
			{"Phonebook", "A large phonebook of everyones phone numbers.", "30", 7, 1,1,false,20},
			{"Dice", "A black dice with white dots, perfect for gambling.", "2", 10, 1,1,false,1},
			{"Golf Club", "Perfect golf club for hitting that hole-in-one.", "60", 2, 1,1,true,30},
			{"Knife", "You're only going to use this in the kitchen, right?", "50", 4,  1,1,true,40},
			{"Baseball Bat", "Hit a home run with this.", "60", 5, 1,1,true,40},
			{"Shovel", "Perfect tool to dig a hole.", "40", 6, 1,1,true,20},
			{"Pool Cue", "For that game of pub pool.", "35", 7, 1,1,true,15},
			{"Cane", "A stick has never been so classy.", "65", 15, 1,1,true,35},
			{"Fire Extinguisher", "There is never one of these around when there is a fire", "50", 42, 500, 1,true,25},
			{"Spray Can", "Hey, you better not tag with this punk!", "50", 41, 500, 1,true,35},
			{"City Guide", "A small city guide booklet.", "15", 18, 1,1,false,7},
			{"Rope", "A long rope.", "15", 46, 1,1,false,2},
			{"Backpack", "A reasonably sized backpack.", "30", 48, 1,1,false,2},
			{"Fishing Rod", "A 7 foot carbon steel fishing rod.", "300", 49, 1,1,false, 175},
			{"Mask", "A comical mask.", "20", 56, 1, 1, false, 5},
			{"Fuel Can", "A small metal fuel canister.", "35", 57, 1, 1, false, 5},

			-- Consumable
			{"Sandwich", "A yummy sandwich with cheese.", "8", 8, 1,2,false,4},
			{"Softdrink", "A can of coca cola.", "7", 9, 1,2,false,3}
		}
	-- gun shop
	elseif(shop_type == 2) then
		item = {
			-- guns --
			{"Brass Knuckles","A pair of brass knuckles, ouch.", "100", 1, 1, 1,true,50},
			{"9mm Pistol", "A silver, 9mm handgun, comes with 100 ammo.", "250",  22, 100, 1,true,200},
			{"Shotgun", "A silver shotgun - comes with 30 ammo.", "450", 25, 30, 1,true,400},
			--{"Uzi", "A small micro-uzi - comes with 250 ammo.", "450", 28, 250, 1,true,190},
			--{"Tec-9", "A Tec-9 micro-uzi - comes with 250 ammo", "500", 32, 250, 1,true,300},
			{"Country Rifle", "A country rifle - comes with 30 ammo", "750", 33, 30, 1,true,600},
			{"Body Armor", "Kevlar Body armor", "500", 999, 0, 1,true,600},
			{"Handcuffs", "A metal pair of handcuffs.", "90", 45, 1,1,false,2}
		}
	-- food + drink
	elseif(shop_type == 3) then
		item = {
			{"Sandwich", "A yummy sandwich with cheese", "5", 8, 1, 1, false,4},
			{"Taco", "A greasy mexican taco", "7", 11, 1, 1, false,3},
			{"Burger", "A double cheeseburger with bacon", "6", 12, 1, 1, false,2},
			{"Donut", "Hot sticky sugar covered donut", "3", 13, 1, 1, false,1},
			{"Cookie", "A luxuty chocolate chip cookie", "3", 14, 1, 1, false,1},
			{"Haggis", "Freshly imported from Scotland", "5", 1, 1, 1, false,1},
			
			-- drinks
			{"Softdrink", "A cold can of coca cola.", "2", 9, 1, 2, false,3},
			{"Water", "A bottle of mineral water.", "1", 15, 1, 2, false,1}
		}
	-- sex shop
	elseif(shop_type == 4) then
		item = {
			-- sexy
			{"Long Purple Dildo","A very large purple dildo", "20", 10, 1, 1, true,10},
			{"Short Tan Dildo","A small tan dildo.", "15", 11, 1, 1, true,7},
			{"Vibrator","A vibrator, what more needs to be said?", "25", 12, 1, 1, true,12},
			{"Flowers","A bouquet of lovely flowers.", "5", 14, 1, 1, true,2}
		}
	elseif(shop_type == 5) then
		availableskins = fittingskins[gender][race]
		for i = 1, #availableskins do
			item[i] = {"Skin "..availableskins[i] , "MTA Skin id "..availableskins[i]..".", "50", 92, availableskins[i], 1}
		end
	-- gym
	elseif(shop_type == 6) then
		item = {
			{"Standard Combat","Standard everyday fighting.", "10", 4, -1, 1, true},
			{"Boxing","<NAME>, on drugs.", "50", 5, -1, 1, true},
			{"<NAME>","I know kung-fu, so can you.", "50", 6, -1, 1, true},
			{"Knee Head","Ever had a knee to the head? Pretty sore.", "50", 7, -1, 1, true},
			{"Grab & Kick","Kick his 'ead in!", "50", 15, -1, 1, true},
			{"Elbows","You may look retarded, but you will kick his ass!", "50", 16, -1, 1, true}
		}
	-- drugs/chemicals
	elseif(shop_type == 7) then
		item = {
			{"<NAME>","A chemical used to make drugs.", "0", 30, 1, 1, false,0},
			{"<NAME>","A chemical used to make drugs.", "0", 31, 1, 1, false,0},
			{"Ly<NAME>","A chemical used to make drugs.", "0", 32, 1, 1, false,0},
			{"Unprocessed PCP","A chemical used to make drugs.", "0", 33, 1, 1, false,0}
		}
	-- electronics
	elseif(shop_type == 8) then
		item = {
			{"Ghettoblaster","A black ghettoblaster.", "250", 54, 1, 1, false,10},
			{"Katana", "Your favourite Japanese sword.", "2000", 8, 1, 1,true,100},
			{"Camera", "A small black analogue camera.", "75", 43, 25,1,true, 30},
			{"Cellphone", "A stylish, slim cell phone.", "75", 2, 1,1,false,50},
			{"Radio", "A black radio.", "50", 6, 1,1,false,30},
			{"Watch", "Telling the time was never so sexy!", "25", 17, 1, 1,false,10},
			{"MP3 Player", "A white, sleek looking MP3 Player. The brand reads EyePod.", "120", 19, 1,1,false,7},
			{"Chemistry Set", "A small chemistry set.", "2000", 44, 1,1,false,15},
			{"Safe", "A Safe to store your items in.", "300", 60, 1,1,false,0}
		}
	-- alcohol shop
	elseif(shop_type == 9) then
		item = {
			{"<NAME>","The finest beer, imported from Holland.", "10", 58, 1, 1, false, 2}
		}
	end
		
{'fraction_non_alphanumeric': 0.1732764747690121, 'fraction_numerical': 0.1435323383084577, 'mean_word_length': 3.84855272226051, 'pattern_counts': {'":': 2, '<': 17, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 182, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2400420', 'n_tokens_mistral': 15264, 'n_tokens_neox': 10630, 'n_words': 3553}