TheIceman1 Posted February 18, 2013 Share Posted February 18, 2013 I cant click on row,whats wrong? local skins = { {"CJ", 0}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, {"Jacket Hippie", 101}, } for u,i in ipairs (skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[1]), true, true) guiGridListSetItemText (GUIEditor_Grid[1], row, 2, tostring(i[3]), true, true) end function use() local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(GUIEditor_Grid[1], row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", row, use) Link to comment
Gallardo9944 Posted February 18, 2013 Share Posted February 18, 2013 you might add onClientGUIClick to your grid list, not to your row. Link to comment
TheIceman1 Posted February 18, 2013 Author Share Posted February 18, 2013 you might add onClientGUIClick to your grid list, not to your row. Dont work Link to comment
TheIceman1 Posted February 18, 2013 Author Share Posted February 18, 2013 Fixed. Whats wrong here?It doesnt give me skin function buy(id) skin = setElementModel(source, id) end addEvent("useSkin",true) addEventHandler("useSkin", root, buy) Link to comment
K4stic Posted February 18, 2013 Share Posted February 18, 2013 first: local skins = { {"CJ", 0}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, {"Jacket Hippie", 101}, } for u,i in ipairs (skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[1]), false, false) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[2])) end function use() local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(GUIEditor_Grid[1], row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", row, use) second: function buy(id) skin = setElementModel(source, id) playeraccount = getPlayerAccount(source) setAccountData(playeraccount, "standardskin", id) end addEvent("useSkin",true) addEventHandler("useSkin", root, buy) Link to comment
TheIceman1 Posted February 18, 2013 Author Share Posted February 18, 2013 first: local skins = { {"CJ", 0}, {"Sweet", 270}, {"Ryder", 300}, {"Ryder 2", 301}, {"Big Smoke", 269}, {"Big Smoke 2", 311}, {"Truth", 1}, {"Wuzi Mu", 294}, {"Claude", 299}, {"Madd Dogg", 297}, {"Mike Toreno", 295}, {"Cesar", 292}, {"OG Loc", 293}, {"T-Bone", 307}, {"Joe Pesci", 258}, {"Pimp", 249}, {"White Dealer", 29}, {"Black Dealer", 28}, {"Hiker", 26}, {"Casino Bouncer 1", 163}, {"Casino Bouncer 2", 164}, {"Drug Worker 1", 144}, {"Drug Worker 2", 145}, {"Drug Worker 3", 146}, {"Jacket Hippie", 101}, } for u,i in ipairs (skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[1]), false, false) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[2])) end function use() local row, col = guiGridListGetSelectedItem(GUIEditor_Grid[1]) if (row and col and row ~= -1 and col ~= -1) then local model = tonumber(guiGridListGetItemData(GUIEditor_Grid[1], row, 1)) if model ~= "" then triggerServerEvent("useSkin", localPlayer, model) end end end addEventHandler("onClientDoubleClick", row, use) second: function buy(id) skin = setElementModel(source, id) playeraccount = getPlayerAccount(source) setAccountData(playeraccount, "standardskin", id) end addEvent("useSkin",true) addEventHandler("useSkin", root, buy) Dont work Link to comment
K4stic Posted February 18, 2013 Share Posted February 18, 2013 and for me how work -.-? Link to comment
TheIceman1 Posted February 18, 2013 Author Share Posted February 18, 2013 and for me how work -.-? I will send you full code via PM. Link to comment
Castillo Posted February 19, 2013 Share Posted February 19, 2013 and for me how work -.-? If it worked for you, it's because you are using a different script, since you aren't setting the grid list item data later used. for u,i in ipairs (skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[1]), false, false) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[2])) end Should be: for _, i in ipairs (skins) do local row = guiGridListAddRow (GUIEditor_Grid[1]) guiGridListSetItemText (GUIEditor_Grid[1], row, 1, tostring(i[1]), false, false) guiGridListSetItemData (GUIEditor_Grid[1], row, 1, tostring(i[2])) end Link to comment
K4stic Posted February 19, 2013 Share Posted February 19, 2013 SolidSnake14 i solve it i fix script in PM with TheIceman1 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