TheIceman1 Posted February 18, 2013 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) Need paid scripter just pm me i will accept every job!
Gallardo9944 Posted February 18, 2013 Posted February 18, 2013 you might add onClientGUIClick to your grid list, not to your row. Code Debugger - Minimalistic MTA debug line replacement
TheIceman1 Posted February 18, 2013 Author Posted February 18, 2013 you might add onClientGUIClick to your grid list, not to your row. Dont work Need paid scripter just pm me i will accept every job!
TheIceman1 Posted February 18, 2013 Author 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) Need paid scripter just pm me i will accept every job!
K4stic Posted February 18, 2013 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) Giving a Fuck? Nope, That isn't in My Skill Set
TheIceman1 Posted February 18, 2013 Author 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 Need paid scripter just pm me i will accept every job!
K4stic Posted February 18, 2013 Posted February 18, 2013 and for me how work -.-? Giving a Fuck? Nope, That isn't in My Skill Set
TheIceman1 Posted February 18, 2013 Author Posted February 18, 2013 and for me how work -.-? I will send you full code via PM. Need paid scripter just pm me i will accept every job!
Castillo Posted February 19, 2013 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 San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
K4stic Posted February 19, 2013 Posted February 19, 2013 SolidSnake14 i solve it i fix script in PM with TheIceman1 Giving a Fuck? Nope, That isn't in My Skill Set
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