TheIceman1 Posted March 5, 2013 Share Posted March 5, 2013 Why this dont set skins on gridlist?No errors local skins = { {"CJ",0,1000}, {"Idk",1,1000} } function setskinsongrid () for key, value in ipairs(skins) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], id[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], name[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], money[3], false, false) end end addEventHandler ( "onClientResourceStart", getThisResource(), setskinsongrid ) Link to comment
PaiN^ Posted March 5, 2013 Share Posted March 5, 2013 local skins = { {"CJ",0,1000}, {"Idk",1,1000} } function setskinsongrid () for key, value in ipairs(skins) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], id[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], name[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], money[3], false, false) end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), setskinsongrid ) Link to comment
Castillo Posted March 5, 2013 Share Posted March 5, 2013 guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], id[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], name[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], money[3], false, false) There's the problem, you are using tables that don't exist. Use this: guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], value[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], value[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], value[3], false, false) Link to comment
TheIceman1 Posted March 5, 2013 Author Share Posted March 5, 2013 local skins = { {"CJ",0,1000}, {"Idk",1,1000} } function setskinsongrid () for key, value in ipairs(skins) do local row = guiGridListAddRow(GUIEditor_Grid[1]) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], id[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], name[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], money[3], false, false) end end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), setskinsongrid ) Nothing happens. Link to comment
TheIceman1 Posted March 5, 2013 Author Share Posted March 5, 2013 guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], id[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], name[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], money[3], false, false) There's the problem, you are using tables that don't exist. Use this: guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[2], value[2], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[1], value[1], false, false) guiGridListSetItemText(GUIEditor_Grid[1], row, GUIEditor_Column[3], value[3], false, false) Working thanks! 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