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: 24
Na forum: 3823 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(339179499460""false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 0.83)

        GUIEditor.button[1] = guiCreateButton(253711558"MK-1 Przy?pieszenie"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(1403711358"MK-1 Pr?dko??"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[2], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[3] = guiCreateButton(2613822057"Demont"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[3], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[4] = guiCreateButton(2510311551"MK-2 Przy?pieszenie"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[5] = guiCreateButton(13810311551"MK-2 Pr?dko??"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[5], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[6] = guiCreateButton(26010322151"Demont"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[6], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[7] = guiCreateButton(2516111550"MK-3 Przy?pieszenie"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[8] = guiCreateButton(14116011251"MK-3 Pr?dko??"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[8], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[9] = guiCreateButton(26116222049"Demont"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[9], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[10] = guiCreateButton(6236938381"Zamknij okno"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[10], "NormalTextColour""FFAAAAAA")    
    end
)


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

marker createMarker(2482.35718, -1658.4516613.33557'cylinder'2.02551700150)

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



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: 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%
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: 24
Na forum: 3823 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[5then 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: 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%
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[5then return end
    triggerServerEvent("ZmienHandling"localPlayer)--MK1 przy?pieszenie
end

addEventHandler "onClientGUIClick"rootfunkcja)


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: 24
Na forum: 3823 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[1then return end
    triggerServerEvent("ZmienHandling"localPlayer)--MK1 przy?pieszenie
    end
)


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


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


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




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

addEventHandler("onClientGUIClick",getRootElement(),
function mk5()
    if source ~= GUIEditor.button[8then 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: 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%
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: 24
Na forum: 3823 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: 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%
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"rootzamykamy)


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: 24
Na forum: 3823 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[10then return end
   guiSetVisible(GUIEditor.window[1], localPlayer)--MK3 pr?dko??
end
addEventHandler "onClientGUIClick"rootzamknij)


[ 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 » Przyciski w gui 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