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

Wysłany: 2016-01-29, 13:56


venzikk

LUA, MODELER






Wiek: 25
Na forum: 3964 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Witam zrobi?em gui nowe i mam tylko problem w client

Bad argument @'addEvendHandler' Expected element at argument 2, got nil]
linijki:98,90,81,73,65

kod:


GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(339, 179, 499, 460, "", false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 0.83)

        GUIEditor.button[1] = guiCreateButton(25, 37, 115, 58, "MK-1 Przy?pieszenie", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(140, 37, 113, 58, "MK-1 Pr?dko??", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(261, 38, 220, 57, "Demont", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[4] = guiCreateButton(25, 103, 115, 51, "MK-2 Przy?pieszenie", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[5] = guiCreateButton(138, 103, 115, 51, "MK-2 Pr?dko??", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[6] = guiCreateButton(260, 103, 221, 51, "Demont", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[7] = guiCreateButton(25, 161, 115, 50, "MK-3 Przy?pieszenie", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[8] = guiCreateButton(141, 160, 112, 51, "MK-3 Pr?dko??", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[8], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[9] = guiCreateButton(261, 162, 220, 49, "Demont", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[9], "NormalTextColour", "FFAAAAAA")
        GUIEditor.button[10] = guiCreateButton(62, 369, 383, 81, "Zamknij okno", false, GUIEditor.window[1])
        guiSetProperty(GUIEditor.button[10], "NormalTextColour", "FFAAAAAA")    
    end
)


addEventHandler("onClientResourceStart",resourceRoot,
function()
guiSetVisible(GUIEditor.window[1],false)
end
)

marker = createMarker(2482.35718, -1658.45166, 13.33557, 'cylinder', 2.0, 255, 170, 0, 150)

function hit()
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEventHandler("onClientMarkerHit", marker, hit)



function mk(button,state)
triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie

end

addEventHandler("onClientGUIClick",GUIEditor.button[1],mk)


function mk2(button,state)
triggerServerEvent("ZmienHandling2", localPlayer)--MK1 Pr?dko??

end

addEventHandler("onClientGUIClick",GUIEditor.button[2],mk2)--MK1 Pr?dko??


function mk4(button,state)
triggerServerEvent("ZmienHandling4", localPlayer)

end

addEventHandler("onClientGUIClick",GUIEditor.button[4],mk3)--MK2 Przy?pieszenie


function mk5(button,state)
triggerServerEvent("ZmienHandling5", localPlayer)

end

addEventHandler("onClientGUIClick",GUIEditor.button[5],mk5)--MK2 Pr?dko??



function mk6(button,state)
triggerServerEvent("ZmienHandling6", localPlayer)

end

addEventHandler("onClientGUIClick",GUIEditor.button[7],mk6)--MK3 Przy?pieszenie


function mk8(button,state)
triggerServerEvent("ZmienHandling8", localPlayer)

end

addEventHandler("onClientGUIClick",GUIEditor.button[6],mk8)-- MK3 Pr?dko??






Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:01


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

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

Ostrzeżeń: 40%
Masz tutaj przyk?ad :

addEventHandler("onClientGUIClick",getRootElement(),
function()
    if source ~= jakis_tam_guzik then return end
    triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie
    end
)


My?l? ?e ju? poradzisz sobie :)

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:11


venzikk

LUA, MODELER






Wiek: 25
Na forum: 3964 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Czyli wygl?da? ma np, tak:



addEventHandler("onClientGUIClick",getRootElement(),
function()
    if source ~= GUIEditor.button[5] then return end
    triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie
    end
)


Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:24


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

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

Ostrzeżeń: 40%
Pffuuuu... przepraszam Ci? , mo?liwe ?e to dzia?a , ale tylko "mo?liwe"
To b?dzie na 100% to :


function funkcja()
if source ~= GUIEditor.button[5] then return end
    triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie
end

addEventHandler ( "onClientGUIClick", root, funkcja)


Sorki m?j b??d...

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Ostatnio zmieniony przez _Wicek_ 2016-01-29, 15:24, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:24


venzikk

LUA, MODELER






Wiek: 25
Na forum: 3964 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

( expected near 'mk0'


linijka 53



kod:

addEventHandler("onClientGUIClick",getRootElement(),
function mk0()
    if source ~= GUIEditor.button[1] then return end
    triggerServerEvent("ZmienHandling", localPlayer)--MK1 przy?pieszenie
    end
)


addEventHandler("onClientGUIClick",getRootElement(),
function mk1()
    if source ~= GUIEditor.button[2] then return end
    triggerServerEvent("ZmienHandling2", localPlayer)--MK1 pr?dko??
    end
)


addEventHandler("onClientGUIClick",getRootElement(),
function mk2()
    if source ~= GUIEditor.button[4] then return end
    triggerServerEvent("ZmienHandling4", localPlayer)--MK2 przy?pieszenie
    end
)


addEventHandler("onClientGUIClick",getRootElement(),
function mk3()
    if source ~= GUIEditor.button[5] then return end
    triggerServerEvent("ZmienHandling3", localPlayer)--MK2 Pr?dko??




addEventHandler("onClientGUIClick",getRootElement(),
function mk4()
    if source ~= GUIEditor.button[7] then return end
    triggerServerEvent("ZmienHandling", localPlayer)--MK3 przy?pieszenie
    end
)

addEventHandler("onClientGUIClick",getRootElement(),
function mk5()
    if source ~= GUIEditor.button[8] then return end
    triggerServerEvent("ZmienHandling11", localPlayer)--MK3 Pr?dko??
    end
)


Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:28


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

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

Ostrzeżeń: 40%
Zobacz do g?ry ^

Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:28


venzikk

LUA, MODELER






Wiek: 25
Na forum: 3964 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

a dobra, sprawdz?

[ Dodano: 2016-01-29, 15:35 ]
Dziena, a jak zrobi? przycisk na zamkni?cia okna?

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:41


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

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

Ostrzeżeń: 40%
Tak samo. Tylko zamiast Trigger to dajesz funkcj?


Więcej informacji znajdziesz w Wikipedii MTA:

guiSetVisible


[ Dodano: 2016-01-29, 15:43 ]
Przyk?ad :

function zamykamy()
if source ~= jaki?_guzik then return end
guiSetVisible(GUIEditor.window[1],false)
showCursor(false)
end

addEventHandler ( "onClientGUIClick", root, zamykamy)


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-01-29, 15:45


venzikk

LUA, MODELER






Wiek: 25
Na forum: 3964 dni
Posty: 235
Nick w MP: VenZ

Piwa: 3158

Respekt: 240
Respekt: 240Respekt: 240

Nie lubi? korzysta? z gui ma?o tam ogarniam :/ ...


function zamknij()
if source ~= GUIEditor.button[10] then return end
   guiSetVisible(GUIEditor.window[1], localPlayer)--MK3 pr?dko??
end
addEventHandler ( "onClientGUIClick", root, zamknij)


[ Dodano: 2016-01-29, 15:47 ]
Dziena :D

[ Dodano: 2016-01-29, 15:48 ]
Do zamkni?cia

Podpis



Hej
,Tak ty! Pomogłem ci? zostaw
:piwo:


Pomagam w miarę możliwości :)

Kontakt:
Discord: VenZio#8080
GG:63293490
skype:szymex1021
Postaw piwo autorowi tego posta
 

 
Tagi: przyciski :: gui
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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