Jump to content

guiCreateScrollBar


Guest Guest26901

Recommended Posts

Hello ! Why my guiCreateScrollBar don't work? I haven't got errors.

  
oknotow = guiCreateWindow((x-600)/2,(y-350)/2,600,350,"System towarów",false) 
guiCreateScrollBar(570,81,14,200,false,false,oknotow) 
guiSetVisible ( oknotow, false ) 
info1 = guiCreateLabel (0.039,0.08,0.7,0.3,"Nazwa", true, oknotow) 
info2 = guiCreateLabel (0.20,0.08,0.7,0.3,"Ilość score", true, oknotow) 
info3 = guiCreateLabel (0.43,0.08,0.7,0.3,"Min. suma", true, oknotow) 
info4 = guiCreateLabel (0.65,0.08,0.7,0.3,"Max. suma", true, oknotow) 
    guiSetFont ( info1, "default-bold-small" ) 
    guiSetFont ( info2, "default-bold-small" ) 
    guiSetFont ( info3, "default-bold-small" ) 
    guiSetFont ( info4, "default-bold-small" ) 
  

Link to comment
  
local towary = { 
                {"Odpady", "Trociny", 0, 20, 50}, 
                {"Odpady", "Puszki", 1, 50, 80}, 
                {"Odpady", "Butelki", 2, 80, 110}, 
                {"Odpady", "Papier", 0, 20, 50}, 
                {"Odpady", "Smoła", 9, 290, 320}, 
                {"Spożywcze", "Jabłka", 3, 110, 140}, 
                {"Spożywcze", "Banany", 6, 200, 230}, 
                {"Spożywcze", "Gruszki", 1, 50, 80}, 
                {"Spożywcze", "Śliwki", 8, 260, 290}, 
                {"Spożywcze", "Mrożonki", 12, 380, 410}, 
                {"Napoje", "Herbata", 7, 230, 260}, 
                {"Napoje", "Tymbark", 17, 530, 560}, 
                {"Napoje", "Kawa", 5, 170, 200}, 
                {"Napoje", "Mleko", 2, 80, 110}, 
                {"Napoje", "Piwo", 16, 500, 530} 
               } 
  
local towar = { } 
local kupuj = { } 
  
local x,y = guiGetScreenSize() 
  
function closegui() 
    guiSetVisible(oknotow, false) 
    showCursor(false) 
end 
  
oknotow = guiCreateWindow((x-600)/2,(y-350)/2,600,350,"System towarów",false) 
guiCreateScrollBar(570,81,14,200,false,false,oknotow) 
guiSetVisible ( oknotow, false ) 
info1 = guiCreateLabel (0.039,0.08,0.7,0.3,"Nazwa", true, oknotow) 
info2 = guiCreateLabel (0.20,0.08,0.7,0.3,"Ilość score", true, oknotow) 
info3 = guiCreateLabel (0.43,0.08,0.7,0.3,"Min. suma", true, oknotow) 
info4 = guiCreateLabel (0.65,0.08,0.7,0.3,"Max. suma", true, oknotow) 
    guiSetFont ( info1, "default-bold-small" ) 
    guiSetFont ( info2, "default-bold-small" ) 
    guiSetFont ( info3, "default-bold-small" ) 
    guiSetFont ( info4, "default-bold-small" ) 
for k, v in ipairs ( towary ) do 
    function zakup(player) 
        if source == kupuj[k]  then 
            player = getLocalPlayer() 
            outputChatBox("Załadowales towar!", player) 
            vehicle = getPedOccupiedVehicle(player) 
            dest = markers[math.random(1, #markers)] 
            destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 1000) 
            marker = createMarker( dest[1], dest[2], dest[3], "cylinder", 3, 255, 255, 0, 255) 
            setElementData(vehicle, "praca", k) 
            setElementData(vehicle, "praca2", true) 
            a, s, d = unpack(dest) 
        end 
    end 
    towar[1] = guiCreateLabel (0.02,0.1+0.08*k,0.2,0.1,v[2],true,oknotow) 
    towar[2] = guiCreateLabel (0.23,0.1+0.08*k,0.2,0.1,v[3],true,oknotow) 
    towar[3] = guiCreateLabel (0.44,0.1+0.08*k,0.2,0.1,v[4].."$",true,oknotow) 
    towar[4] = guiCreateLabel (0.66,0.1+0.08*k,0.2,0.1,v[5].."$",true,oknotow) 
    kupuj[k] = guiCreateButton (0.81,0.095+0.08*k,0.13,0.06,"Załaduj",true,oknotow) 
        addEventHandler ( "onClientGUIClick", kupuj[k], zakup, false ) 
end 
zamknij = guiCreateButton (0.45,0.9,0.15,0.07,"Zamknij",true,oknotow) 
    addEventHandler ( "onClientGUIClick", zamknij, closegui, false ) 
  

Link to comment
  • Other Languages Moderators
local towary = { 
                {"Odpady", "Trociny", 0, 20, 50}, 
                {"Odpady", "Puszki", 1, 50, 80}, 
                {"Odpady", "Butelki", 2, 80, 110}, 
                {"Odpady", "Papier", 0, 20, 50}, 
                {"Odpady", "Smoła", 9, 290, 320}, 
                {"Spożywcze", "Jabłka", 3, 110, 140}, 
                {"Spożywcze", "Banany", 6, 200, 230}, 
                {"Spożywcze", "Gruszki", 1, 50, 80}, 
                {"Spożywcze", "Śliwki", 8, 260, 290}, 
                {"Spożywcze", "Mrożonki", 12, 380, 410}, 
                {"Napoje", "Herbata", 7, 230, 260}, 
                {"Napoje", "Tymbark", 17, 530, 560}, 
                {"Napoje", "Kawa", 5, 170, 200}, 
                {"Napoje", "Mleko", 2, 80, 110}, 
                {"Napoje", "Piwo", 16, 500, 530} 
               } 
  
local towar = { } 
local kupuj = { } 
  
local x,y = guiGetScreenSize() 
  
function closegui() 
    guiSetVisible(oknotoww, false) 
    showCursor(false) 
end 
  
oknotoww = guiCreateWindow((x-600)/2,(y-350)/2,600,350,"System towarów",false) 
oknotow = guiCreateScrollPane(0.05,0.05,1,1,true,oknotoww) 
guiSetVisible ( oknotoww, false ) 
info1 = guiCreateLabel (0.039,0.08,0.2,0.3,"Nazwa", true, oknotow) 
info2 = guiCreateLabel (0.20,0.08,0.2,0.3,"Ilość score", true, oknotow) 
info3 = guiCreateLabel (0.43,0.08,0.2,0.3,"Min. suma", true, oknotow) 
info4 = guiCreateLabel (0.65,0.08,0.2,0.3,"Max. suma", true, oknotow) 
    guiSetFont ( info1, "default-bold-small" ) 
    guiSetFont ( info2, "default-bold-small" ) 
    guiSetFont ( info3, "default-bold-small" ) 
    guiSetFont ( info4, "default-bold-small" ) 
for k, v in ipairs ( towary ) do 
    function zakup(player) 
        if source == kupuj[k]  then 
            player = getLocalPlayer() 
            outputChatBox("Załadowales towar!", player) 
            vehicle = getPedOccupiedVehicle(player) 
            dest = markers[math.random(1, #markers)] 
            destblip = createBlip( dest[1], dest[2], dest[3], 41, 2, 255, 255, 0, 0, 1000) 
            marker = createMarker( dest[1], dest[2], dest[3], "cylinder", 3, 255, 255, 0, 255) 
            setElementData(vehicle, "praca", k) 
            setElementData(vehicle, "praca2", true) 
            a, s, d = unpack(dest) 
        end 
    end 
    towar[1] = guiCreateLabel (0.02,0.1+0.08*k,0.2,0.1,v[2],true,oknotow) 
    towar[2] = guiCreateLabel (0.23,0.1+0.08*k,0.2,0.1,v[3],true,oknotow) 
    towar[3] = guiCreateLabel (0.44,0.1+0.08*k,0.2,0.1,v[4].."$",true,oknotow) 
    towar[4] = guiCreateLabel (0.66,0.1+0.08*k,0.2,0.1,v[5].."$",true,oknotow) 
    kupuj[k] = guiCreateButton (0.81,0.095+0.08*k,0.13,0.06,"Załaduj",true,oknotow) 
        addEventHandler ( "onClientGUIClick", kupuj[k], zakup, false ) 
end 
zamknij = guiCreateButton (0.45,0.9,0.15,0.07,"Zamknij",true,oknotow) 
    addEventHandler ( "onClientGUIClick", zamknij, closegui, false ) 
  

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