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

Wysłany: 2016-04-05, 13:21


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

Mam problem z montowaniem MK, mianowicie gdy kto? wjedzie w marker to kazdemu wyswietla sie GUI z wyborem MK.
Kod strona clienta:


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\n (3900$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(1403711358"MK-1 Pr?dko??\n (4600$)"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\n (5100$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[5] = guiCreateButton(13810311551"MK-2 Pr?dko??\n (5900$)"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\n (6300$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[8] = guiCreateButton(14116011251"MK-3 Pr?dko??\n (6900$)"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( -2479, -17524.5'cylinder'3.00255070)

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



function mk1()
if source ~= GUIEditor.button[1then return end
    triggerServerEvent("ZmienHandling"localPlayer)--MK1 przy?pieszenie
end

addEventHandler "onClientGUIClick"rootmk1)


function mk2()
if source ~= GUIEditor.button[2then return end
    triggerServerEvent("ZmienHandling2"localPlayer)--MK1 predko?c
end

addEventHandler "onClientGUIClick"rootmk2)

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

addEventHandler "onClientGUIClick"rootmk3)


function mk4()
if source ~= GUIEditor.button[5then return end
    triggerServerEvent("ZmienHandling5"localPlayer)--MK2 pr?dko??
end

addEventHandler "onClientGUIClick"rootmk4)


function mk5()
if source ~= GUIEditor.button[7then return end
    triggerServerEvent("ZmienHandling12"localPlayer)--MK3 przy?pieszenie
end

addEventHandler "onClientGUIClick"rootmk5)


function mk6()
if source ~= GUIEditor.button[8then return end
    triggerServerEvent("ZmienHandling11"localPlayer)--MK3 pr?dko??
end
addEventHandler "onClientGUIClick"rootmk6)



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


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

addEventHandler "onClientGUIClick"rootzamykamy)


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-05, 14:28


AteX







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

Piwa: 8360

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

function hit(plr)
if plr ~= localPlayer then return end
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
addEventHandler("onClientMarkerHit"markerhit)


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

 
Wysłany: 2016-04-05, 17:05


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

AteX, Problem dalej wyst?puje

Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-05, 17:08


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 | .
Spr?buj tak xd
function hit(el)
if el ~= localPlayer then 
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
end
addEventHandler("onClientMarkerHit"markerhit)


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-04-05, 21:23


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611



GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart"resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(339179499460""false)
        guiSetVisible(GUIEditor.window[1],false)
        guiWindowSetSizable(GUIEditor.window[1], false)
        guiSetAlpha(GUIEditor.window[1], 0.83)

        GUIEditor.button[1] = guiCreateButton(253711558"MK-1 Przy?pieszenie\n (3900$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[1], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[2] = guiCreateButton(1403711358"MK-1 Pr?dko??\n (4600$)"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\n (5100$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[4], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[5] = guiCreateButton(13810311551"MK-2 Pr?dko??\n (5900$)"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\n (6300$)"falseGUIEditor.window[1])
        guiSetProperty(GUIEditor.button[7], "NormalTextColour""FFAAAAAA")
        GUIEditor.button[8] = guiCreateButton(14116011251"MK-3 Pr?dko??\n (6900$)"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
)



marker createMarker( -2479, -17524.5'cylinder'3.00255070)

function hit(ele)
    if source == marker then else return end
    if getElementTypeele ) == "player" then else return end
    if ele == getLocalPlayer() then else return end
    if isElementWithinMarker elemarker then else return end
    guiSetVisible(GUIEditor.window[1], true)
    showCursor(true)
end
addEventHandler("onClientMarkerHit"markerhit)



function mk1()
if source ~= GUIEditor.button[1then return end
    triggerServerEvent("ZmienHandling"localPlayer)--MK1 przy?pieszenie
end

addEventHandler "onClientGUIClick"rootmk1)


function mk2()
if source ~= GUIEditor.button[2then return end
    triggerServerEvent("ZmienHandling2"localPlayer)--MK1 predko?c
end

addEventHandler "onClientGUIClick"rootmk2)

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

addEventHandler "onClientGUIClick"rootmk3)


function mk4()
if source ~= GUIEditor.button[5then return end
    triggerServerEvent("ZmienHandling5"localPlayer)--MK2 pr?dko??
end

addEventHandler "onClientGUIClick"rootmk4)


function mk5()
if source ~= GUIEditor.button[7then return end
    triggerServerEvent("ZmienHandling12"localPlayer)--MK3 przy?pieszenie
end

addEventHandler "onClientGUIClick"rootmk5)


function mk6()
if source ~= GUIEditor.button[8then return end
    triggerServerEvent("ZmienHandling11"localPlayer)--MK3 pr?dko??
end
addEventHandler "onClientGUIClick"rootmk6)



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


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

addEventHandler "onClientGUIClick"rootzamykamy)

Sprawdz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-05, 21:49


Jurandovsky

Kurdebele






Wiek: 17
Na forum: 4838 dni
Posty: 915

Piwa: 2697

Respekt: 955,3
Respekt: 955,3Respekt: 955,3

Mo?e milion tych warunk?w luki? x'd



function hit(el)
if el == localPlayer then 
guiSetVisible(GUIEditor.window[1], true)
showCursor(true)
end
end
addEventHandler("onClientMarkerHit"markerhit)


Podpis
Jedyny kontakt ze mną to PW forum

Kod:


local noobs = getElementsByTitle("player", "Programista LUA")
for k, v in ipairs(noobs) do
outputChatBox("Bez mózgu jest użytkownik o nicku: "..getPlayerName(v), root)
destroyElement(v)
end
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-05, 23:24


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Jurandovsky, co do miliona warunk?w to ka?dy zabezpiecza funkcj?.
A co do kodu Twojego to dalej ka?demu si? b?dzie w??cza?, poniewa? nie jest sprawdzanie czy jest odpowiedni marker w kt?ry gracz powinien wjecha?.

Postaw piwo autorowi tego posta
 

 
Tagi: kazdym :: sie :: wyswietla :: 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 » Kazdym sie wyswietla 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