Oussema Posted March 24, 2017 Share Posted March 24, 2017 this part in client for i, v in pairs (vehs.model) do row = guiGridListAddRow ( GUIEditor.gridlist[1] ) guiGridListSetItemText ( GUIEditor.gridlist[1], row, 1, getVehicleNameFromModel(v), false, false ) guiGridListSetItemData ( GUIEditor.gridlist[1], row, 1, getVehicleNameFromModel(v)) for k, mddn in pairs (vehs.mod) do guiGridListSetItemText ( GUIEditor.gridlist[1], row, 2, mddn, false, false ) end for x, price in pairs (vehs.price) do guiGridListSetItemText ( GUIEditor.gridlist[1], row, 3, convertNumber(price), false, false ) end end look at this screenshto what im geting the vehicels names fine but Modification and Price is seting all same Please help Link to comment
Tails Posted March 24, 2017 Share Posted March 24, 2017 (edited) Because what you're doing is, for every row loop through all the rows in the gridlist and set the table value to each of them. what you want to do is do it all in a single loop and maybe redo your table. Maybe something like this: local vehs = { {model = 411, mod = 4, price = 12000}, -- 1 {model = 411, mod = 4, price = 12000}, -- 2 etc.. } for i, v in pairs (vehs) do local row = guiGridListAddRow ( GUIEditor.gridlist[1], getVehicleNameFromModel(v.model), v.mod, v.price) guiGridListSetItemData ( GUIEditor.gridlist[1], row, 1, v.model) end Also in 1.5.2 or so, they introduced an alternative easier way to set the text of a row for each column, the syntax is like this: int guiGridListAddRow ( element gridList, int/string itemText1, int/string itemText2, ... ) where itemText1 is for column 1 and itemText2 for column 2 and so on. Edited March 24, 2017 by Tails 1 Link to comment
Oussema Posted March 24, 2017 Author Share Posted March 24, 2017 (edited) yaaayayayayay i just changed table format in server side thx thx thx so much really you helped me Edited March 24, 2017 by Oussema Sloved that's why 1 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