Fabio(GNR) Posted May 7, 2011 Posted May 7, 2011 My second topic today ( sorry ) Im using getvehiclemodelfromname, it should get it from a variable: a = guiGridListGetSelectedItem ( list ) id = getVehicleModelFromName ( a ) -- wrong id = getVehicleModelFromName ( tostring(a) ) -- wrong id = getVehicleModelFromName ( "tostring(a)" ) -- wrong id = getVehicleModelFromName ( "Alpha" ) -- works How to let it know it's a variable? EDIT: Found the error, now how to fix it? The error is my gridlist give's a number instead of the variable. in example: Alpha = guiGridListAddRow ( list ) guiGridListSetItemText ( list_vehicles, Alpha, vehicle_column, "Alpha", false, false ) This gives me a number, : 0. Second i created gives me a 1. How to get the variable's name? EDIT2: I used guiGridListGetSelectedItem which will give you the number. Any way to get the text in it? So from the row i selected? LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
DakiLLa Posted May 7, 2011 Posted May 7, 2011 local row, col = guiGridListGetSelectedItem( yourGridList ) local text = guiGridListGetItemText( yourGrildList, row, col ) outputChatBox( getVehicleModelFromName( text ) )
Fabio(GNR) Posted May 7, 2011 Author Posted May 7, 2011 Lol, pretty simple. thanks alot, didnt test it yet it should just work. LuaCompiler United Social Gamers [ CnR / DD / DM & more ]
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