Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-03-19, 11:10


nox







Wiek: 33
Na forum: 3766 dni
Posty: 51
Nick w MP: nox



Respekt: 50

witam stworzy?em sobie gui i wgra?em je do mta poprzez gui editora. W gui editorze powsta? mi taki kod :

GUIEditor = {
    gridlist = {},
    staticimage = {},
    label = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        GUIEditor.staticimage[1] = guiCreateStaticImage((screenW 422) / 2, (screenH 369) / 2422369":guieditor/images/1.png"false)

        GUIEditor.label[1] = guiCreateLabel(28212014037""falseGUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(28317113935""falseGUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(28322213934""falseGUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(28326813932""falseGUIEditor.staticimage[1])
        GUIEditor.gridlist[1] = guiCreateGridList(-324210349falseGUIEditor.staticimage[1])
        guiSetAlpha(GUIEditor.gridlist[1], 0.00)    
    end

Teraz chcia?bym wiedzie? co dopisa?, aby panel otwiera? mi si? pod komende, mam taki kod, ale po jego dopisaniu pojawia si? tylko kursor a panel si? nie otwiera :

function openPanel()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Co musze dopisac ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:17


maciek3286

LUA Developer






Wiek: 26
Na forum: 5201 dni
Posty: 230
Nick w MP: maciek00

Piwa: 3207

Respekt: 101,5
Respekt: 101,5


function openPanel()
guiSetVisible(GUIEditor.staticimage [1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Spr?buj tak ;)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:23


nox







Wiek: 33
Na forum: 3766 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"maciek3286" napisał/a:


function openPanel()
guiSetVisible(GUIEditor.staticimage [1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Spr?buj tak ;)


Obrazek juz si? pojawia, problem w tym ze nie pojawia si? na komende tylko od razu po uruchomieniu skryptu, co zmienic ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:28


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Przy starcie skryptu, czyli evencie onClientResourceStart, musisz u?y? guiSetVisible(GUIEditor.staticimage[1],false)

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:40


nox







Wiek: 33
Na forum: 3766 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"AteX" napisał/a:

Przy starcie skryptu, czyli evencie onClientResourceStart, musisz u?y? guiSetVisible(GUIEditor.staticimage[1],false)


GUIEditor = {
    gridlist = {},
    staticimage = {},
    label = {}
}
addEventHandler("onClientResourceStart" guiSetVisible(GUIEditor.staticimage[1],false) , resourceRoot
    function()
local screenWscreenH guiGetScreenSize()
        GUIEditor.staticimage[1] = guiCreateStaticImage((screenW 422) / 2, (screenH 369) / 2422369":guieditor/images/1.png"false)

        GUIEditor.label[1] = guiCreateLabel(28212014037""falseGUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(28317113935""falseGUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(28322213934""falseGUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(28326813932""falseGUIEditor.staticimage[1])
        GUIEditor.gridlist[1] = guiCreateGridList(-324210349falseGUIEditor.staticimage[1])
        guiSetAlpha(GUIEditor.gridlist[1], 0.00)    
    end
)
function openPanel()
guiSetVisible(GUI.editor.staticimage [1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Tak to b?dzie wygladac ? jak nie to mozesz poprawic ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:43


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .

GUIEditor = {
    gridlist = {},
    staticimage = {},
    label = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        GUIEditor.staticimage[1] = guiCreateStaticImage((screenW 422) / 2, (screenH 369) / 2422369":guieditor/images/1.png"false)

        GUIEditor.label[1] = guiCreateLabel(28212014037""falseGUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(28317113935""falseGUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(28322213934""falseGUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(28326813932""falseGUIEditor.staticimage[1])
        GUIEditor.gridlist[1] = guiCreateGridList(-324210349falseGUIEditor.staticimage[1])
        guiSetAlpha(GUIEditor.gridlist[1], 0.00)    
        guiSetVisible(GUIEditor.staticimage[1],false) 
    end
)

function openPanel()
guiSetVisible(GUI.editor.staticimage [1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Testuj

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:53


nox







Wiek: 33
Na forum: 3766 dni
Posty: 51
Nick w MP: nox



Respekt: 50

nadal si? nie otwiera wgl.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:58


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .

GUIEditor = {
    gridlist = {},
    staticimage = {},
    label = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        GUIEditor.staticimage[1] = guiCreateStaticImage((screenW 422) / 2, (screenH 369) / 2422369":guieditor/images/1.png"false)

        GUIEditor.label[1] = guiCreateLabel(28212014037""falseGUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(28317113935""falseGUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(28322213934""falseGUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(28326813932""falseGUIEditor.staticimage[1])
        GUIEditor.gridlist[1] = guiCreateGridList(-324210349falseGUIEditor.staticimage[1])
        guiSetAlpha(GUIEditor.gridlist[1], 0.00)    
        guiSetVisible(GUIEditor.staticimage[1],false) 
    end
)

function openPanel()
guiSetVisible(GUIEditor.staticimage[1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)


Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 11:59


_Wicek_

Majstersztyk






Wiek: 25
Na forum: 4260 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1841

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
nox, Jakie? b??dy w debugu ?

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 12:01


Emm

***** ***






Wiek: 32
Na forum: 3880 dni
Posty: 3191
Nick w MP: Emm

Piwa: 6162

Respekt: 1580
Respekt: 1580Respekt: 1580


   Administrator: Admin ma zawsze rację | REGULAMIN FORUM | REKLAMA/VIP | .
"Wicek7" napisał/a:

nox, Jakie? b??dy w debugu ?

Z?a nazwa wcze?niej by?a gui, zamiast "GUIEditor.staticimage[1]" by?o "Gui.editor.staticimage [1]" czy co? takiego

Podpis

Użytkownik: 20.10.2015r
GTAO Member: 06.03.2016r
Support-Team: 20.01.2016r
Moderator: 30.03.2016r
Mod-Team: 08.10.2016r
Vice Admin: 04.05.2018r
Administrator: 03.05.2022r


! Koniecznie zapoznaj się z regulaminem forum.
Pamiętaj, aby zawsze go przestrzegać, nie mniej ważne są również regulaminy działów, w których się wypowiadasz!
Zamiast zakładać temat po kilka razy, bo jest usuwany przez Administrację, przejrzyj regulamin i napisz poprawnie temat!
Sprawy z administracją możesz załatwiać anonimowo w tym dziale.
Najważniejsze informacje od Administracji możesz przeczytać tutaj oraz tutaj.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-03-19, 12:15


nox







Wiek: 33
Na forum: 3766 dni
Posty: 51
Nick w MP: nox



Respekt: 50

"Emm" napisał/a:


GUIEditor = {
    gridlist = {},
    staticimage = {},
    label = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
local screenWscreenH guiGetScreenSize()
        GUIEditor.staticimage[1] = guiCreateStaticImage((screenW 422) / 2, (screenH 369) / 2422369":guieditor/images/1.png"false)

        GUIEditor.label[1] = guiCreateLabel(28212014037""falseGUIEditor.staticimage[1])
        GUIEditor.label[2] = guiCreateLabel(28317113935""falseGUIEditor.staticimage[1])
        GUIEditor.label[3] = guiCreateLabel(28322213934""falseGUIEditor.staticimage[1])
        GUIEditor.label[4] = guiCreateLabel(28326813932""falseGUIEditor.staticimage[1])
        GUIEditor.gridlist[1] = guiCreateGridList(-324210349falseGUIEditor.staticimage[1])
        guiSetAlpha(GUIEditor.gridlist[1], 0.00)    
        guiSetVisible(GUIEditor.staticimage[1],false) 
    end
)

function openPanel()
guiSetVisible(GUIEditor.staticimage[1], true)
showCursor(true)
end
addCommandHandler("panelpd"openPanel)

Leci piweczko :) dzi?kuje wszystkim za pomoc

Postaw piwo autorowi tego posta
 

 
Tagi: funkcje
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » funkcje Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku