Jump to content

Help please.


TheIceman1

Recommended Posts

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

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
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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...