.:HyPeX:. Posted February 17, 2014 Share Posted February 17, 2014 Im doing something wrong? the wheels arent being shown when i open the gui.. local x,y = guiGetScreenSize() RadioWindow = guiCreateWindow(0.1, 0.2, 0.85, 0.6, "Wheel Script by HyPeX", true) RadioButton = guiCreateButton ( 0.05, 0.1, 0.2, 0.1, "Buy Wheels", true, RadioWindow ) DeleteButton = guiCreateButton( 0.3, 0.1, 0.2, 0.1, "Refund Wheels", true, RadioWindow) RadioPlayButton = guiCreateButton( 0.05, 0.25, 0.2, 0.1, "Select Wheels", true, RadioWindow) RadioWindowCloseButton = guiCreateButton( 0.05, 0.68, 0.45, 0.1, "Close Window", true, RadioWindow) RadioStopButton = guiCreateButton( 0.3, 0.25, 0.2, 0.1, "Unload Wheels", true, RadioWindow) RadioGetNameButton = guiCreateButton( 0.05, 0.4, 0.2, 0.1, "Show Selected Wheel", true, RadioWindow) RadioGrid = guiCreateGridList( 0.55, 0.1, 0.4, 0.8, true, RadioWindow) guiGridListSetScrollBars(RadioGrid,false,true) StationIDColumn = guiGridListAddColumn( RadioGrid, "ID", 0.2) StationNameColumn = guiGridListAddColumn( RadioGrid, "Wheel Name", 0.4) StationLinkColumn = guiGridListAddColumn( RadioGrid, "Price", 0.5) Wheels = {} Wheels["1085"] = {name = "Big Ray Wheel", price = "25000"} Wheels["1096"] = {name = "Black Badass", price = "25000"} Wheels["1097"] = {name = "Styled Wheels", price = "25000"} Wheels["1098"] = {name = "Common Badass", price = "25000"} Wheels["1079"] = {name = "NFS Wheel 1", price = "25000"} Wheels["1075"] = {name = "Cool Wheel 1", price = "25000"} Wheels["1074"] = {name = "Styled Black", price = "25000"} Wheels["1081"] = {name = "Cool Grey", price = "25000"} Wheels["1080"] = {name = "NFS Wheel 2", price = "25000"} Wheels["1073"] = {name = "Organe", price = "25000"} Wheels["1077"] = {name = "Cool Wheel 2", price = "25000"} Wheels["1083"] = {name = "Golden Style", price = "25000"} Wheels["1082"] = {name = "Shainy White", price = "25000"} Wheels["1078"] = {name = "Cool Wheel 3", price = "25000"} Wheels["1076"] = {name = "Cool Rays", price = "25000"} Wheels["1084"] = {name = "Golden Badass", price = "25000"} Wheels["1025"] = {name = "4x4", price = "25000"} for i,v in ipairs(Wheels) do local text = guiGetText( v.name ) local text2 = guiGetText( v.price ) local row = guiGridListAddRow ( RadioGrid ) local count = i guiGridListSetItemText ( RadioGrid, row, StationIDColumn, tostring(count), false, false ) guiGridListSetItemText ( RadioGrid, row, StationNameColumn, text, false, false ) guiGridListSetItemText ( RadioGrid, row, StationLinkColumn, text2, false, false ) end guiSetVisible(RadioWindow, false) addCommandHandler("gui", function () if guiGetVisible(RadioWindow) == true then guiSetVisible(RadioWindow, false) showCursor(false) else guiSetVisible(RadioWindow, true) showCursor(true) end end, false) Link to comment
Castillo Posted February 17, 2014 Share Posted February 17, 2014 You are using "ipairs", but that is only used for indexed tables, and yours isn't. Link to comment
.:HyPeX:. Posted February 17, 2014 Author Share Posted February 17, 2014 You are using "ipairs", but that is only used for indexed tables, and yours isn't. What i could do then? and could you help me, i never heared about indexed or not indexed tables Link to comment
Castillo Posted February 17, 2014 Share Posted February 17, 2014 wheels = { { name = "Big Ray Wheel", price = "25000", upgrade = 1085 }, { name = "Black Badass", price = "25000", upgrade = 1096 }, { name = "Styled Wheels", price = "25000", upgrade = 1097 }, { name = "Common Badass", price = "25000", upgrade = 1098 }, { name = "NFS Wheel 1", price = "25000", upgrade = 1079 }, { name = "Cool Wheel 1", price = "25000", upgrade = 1075 }, { name = "Styled Black", price = "25000", upgrade = 1074 }, { name = "Cool Grey", price = "25000", upgrade = 1081 }, { name = "NFS Wheel 2", price = "25000", upgrade = 1080 }, { name = "Organe", price = "25000", upgrade = 1073 }, { name = "Cool Wheel 2", price = "25000", upgrade = 1077 }, { name = "Golden Style", price = "25000", upgrade = 1083 }, { name = "Shainy White", price = "25000", upgrade = 1082 }, { name = "Cool Wheel 3", price = "25000", upgrade = 1078 }, { name = "Cool Rays", price = "25000", upgrade = 1076 }, { name = "Golden Badass", price = "25000", upgrade = 1084 }, { name = "4x4", price = "25000", upgrade = 1025 } } Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now