Jump to content

Skin Shop - problem


Matevsz

Recommended Posts

well then I removed the function Pokaz Gui () and changed the marker.

New GUI also changed because those were bad. Now it looks like this:

C:

  
GUIEditor = { 
    gridlist = {}, 
    window = {}, 
    button = {} 
} 
addEventHandler("onClientResourceStart", resourceRoot, 
function() 
    GUIEditor.window[1] = guiCreateWindow(1195, 349, 361, 509, "Skin Shop v.1.0.0 by Matevsz/teusz0724k", false) 
    guiWindowSetSizable(GUIEditor.window[1], false) 
    GUIEditor.gridlist[1] = guiCreateGridList(9, 24, 342, 422, false, GUIEditor.window[1]) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "Nazwa", 0.5) 
    guiGridListAddColumn(GUIEditor.gridlist[1], "ID", 0.5) 
    GUIEditor.button[1] = guiCreateButton(118, 463, 134, 31, "Zamknij", false, GUIEditor.window[1]) 
    guiSetVisible(GUIEditor.window[1], false) 
    addEventHandler("onClientGUIClick", GUIEditor.button[1], function () guiSetVisible(GUIEditor.window[1], false) showCursor(false) setPlayerHudComponentVisible("all", true) setElementModel(localPlayer, Model) setElementFrozen(localPlayer, false) end, false) 
    addEventHandler("onClientGUIDoubleClick", GUIEditor.girldlist[1], WybierzSkina, false) 
end  
) 
  
  
function showSkin(skinsTable) 
    guiGridListClear(GUIEditor.girldlist[1]) 
    setElementFrozen(localPlayer, true) 
    for category, skins in pairs(skinsTable) do 
        local row = guiGridListAddRow(GUIEditor.girldlist[1]) 
        guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, category, true, false) 
        for id, name in pairs(skins) do 
            local row = guiGridListAddRow(GUIEditor.girldlist[1]) 
            guiGridListSetItemText(GUIEditor.girldlist[1], row, 1, name, false, false) 
            guiGridListSetItemText(GUIEditor.girldlist[1], row, 2, id, false, false) 
        end 
    end 
    guiSetVisible(GUIEditor.window[1], true) 
    showCursor(true) 
    model = getElementModel(localPlayer) 
end 
addEvent("clothes.showSkin", true) 
addEventHandler("clothes.showSkin", root, showSkin) 
  
function previewSkin() 
    local row = guiGridListGetSelectedItem(GUIEditor.girldlist[1]) 
    if (not row or row == -1) then return end 
    local id = guiGridListGetItemText(GUIEditor.girldlist[1], row, 2) 
    id = tonumber(id) 
    if (not id) then return end 
    setElementModel(localPlayer, id) 
end 
  
function WybierzSkina() 
    local row = guiGirdListGetSelectedItem(GUIEditor.girldlist[1]) 
    if (not row or row == -1) then return end 
    local id = guiGirdListGetItemText(GUIEditor.girldlist[1], row, 2) 
    id = tonumber(id) 
    if (not id) then return end 
    setElementModel(localPlayer, model) 
    setElementFrozen(localPlayer, false) 
    guiSetVisible(GUIEditor.window[1], false) 
    showCursor(false) 
    triggerServerEvent("clothes.WybierzSkina", root, id) 
end 
  
function wMarkerze(center_window) 
    local screenW,screenH= guiGetScreenSize() 
    local windowW,windowH= guiGetSize(center_window,false) 
    local x,y = (screenW-windowW)/2,(screenH-windowH)/2 
    guiSetPosition(center_window,x,y,false) 
end 
  

And now after the removal Slideshow Gui () you can not even see the cursor

Link to comment
well then I removed the function Pokaz Gui () and changed the marker.

New GUI also changed because those were bad. Now it looks like this:

And now after the removal Slideshow Gui () you can not even see the cursor

it's already removed in my code man you are wasting your time read the wiki page before you start scripting , as i told you many things wrong in your code . more than that i'm pretty sure that you are not the owner of this script.

simply because getSkinsTable it's not defined in your code so how you want to make the script working without checking the skins category. i will never help you again.

Link to comment
well then I removed the function Pokaz Gui () and changed the marker.

New GUI also changed because those were bad. Now it looks like this:

And now after the removal Slideshow Gui () you can not even see the cursor

it's already removed in my code man you are wasting your time read the wiki page before you start scripting , as i told you many things wrong in your code . more than that i'm pretty sure that you are not the owner of this script.

simply because getSkinsTable it's not defined in your code so how you want to make the script working without checking the skins category. i will never help you again.

Why is that? because the script edits? You're right it is not mine script, but I corrected him under my server, that's what I can do and what I can not ask in the forum ...

Why not see the list of skinheads in the gridList?

Debugscript - Client (15), bad argument @ 'setElementModel' [expected number at argument 2, not nil]

SS:

10ri7gw.jpg

C:

  
local screenWidth, screenHeight = guiGetScreenSize() 
  
function createSkinWindow() 
    windowWidth, windowHeight = 335, 414 
    windowX, windowY = (screenWidth / 1) - (windowWidth / 1), (screenHeight / 2) - (windowHeight / 2) 
    skinWindow = guiCreateWindow(windowX, windowY, windowWidth, windowHeight, "Skin Shop", false) 
    guiSetAlpha(skinWindow, 1) 
    skinGridlist = guiCreateGridList(9, 25, 317, 325, false, skinWindow) 
    skinTitleColumn = guiGridListAddColumn(skinGridlist, "Nazwa", 0.45) 
    skinIDColumn = guiGridListAddColumn(skinGridlist, "ID", 0.2) 
    skinExitButton = guiCreateButton(194, 371, 132, 33, "Zamknij", false, skinWindow) 
    guiSetVisible(skinWindow, false) 
  
    --Events 
    addEventHandler("onClientGUIClick", skinExitButton, function () guiSetVisible(skinWindow, false) showCursor(false) setPlayerHudComponentVisible("all", false) setElementModel(localPlayer, model) setElementFrozen(localPlayer, false) end, false) 
    addEventHandler("onClientGUIDoubleClick", skinGridlist, previewSkin, false) 
end 
addEventHandler("onClientResourceStart", resourceRoot, createSkinWindow) 
  
function showSkin(skinsTable) 
    guiGridListClear(skinGridlist) 
    setElementFrozen(localPlayer, true) 
    for category, skins in pairs(skinsTable) do 
        local row = guiGridListAddRow(skinGridlist) 
        guiGridListSetItemText(skinGridlist, row, 1, category, true, false) 
        for id, name in pairs(skins) do 
            local row = guiGridListAddRow(skinGridlist) 
            guiGridListSetItemText(skinGridlist, row, 1, name, false, false) 
            guiGridListSetItemText(skinGridlist, row, 2, id, false, false) 
        end 
    end 
    guiSetVisible(skinWindow, true) 
    showCursor(true) 
    model = getElementModel(localPlayer) 
end 
addEvent("clothes.showSkin", true) 
addEventHandler("clothes.showSkin", root, showSkin) 
  
function previewSkin() 
    local row = guiGridListGetSelectedItem(skinGridlist) 
    if (not row or row == -1) then return end 
    local id = guiGridListGetItemText(skinGridlist, row, 2) 
    id = tonumber(id) 
    if (not id) then return end 
    setElementModel(localPlayer, id) 
end 
  
function buySkin() 
    local row = guiGridListGetSelectedItem(skinGridlist) 
    if (not row or row == -1) then return end 
    local id = guiGridListGetItemText(skinGridlist, row, 2) 
    id = tonumber(id) 
    if (not id) then return end 
    setElementModel(localPlayer, model) 
    setElementFrozen(localPlayer, false) 
    guiSetVisible(skinWindow, false) 
    showCursor(false) 
    triggerServerEvent("clothes.buySkin", root, id) 
    triggerServerEvent("clothes.buySkin", root, id) 
end 
  
function showGui() 
    guiSetVisible(skinWindow, true) 
    showCursor(true) 
end 
addEvent("ShowGui", true) 
addEventHandler("ShowGui",root,showGui) 
  

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