Jump to content

Gui Help!


.:HyPeX:.

Recommended Posts

Posted

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) 

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted

You are using "ipairs", but that is only used for indexed tables, and yours isn't.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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 :lol:

My ingame nick is ~HyPeX~

BF3 Gamemode Progress: ~30% - Currently working on AI & MapManager

gKhdyRJ.png

Posted
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 } 
    } 

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...