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

Wysłany: 2017-08-22, 20:19


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

Witam
Chc? aby ?wiat?a na kominie MRUGA?Y CO PAR? SEKUND, lecz niewiem jak si? do tego zabra?.

local SwiatlaNaKominie={
{649.90002441406, -751.20001220703, 154.69999694824}, --Marker CORONA 0.55 size
{654.79998779297, -752.09997558594, 154.69999694824},
{655, -757.29998779297, 154.69999694824},
{649.79998779297, -758.20001220703, 154.60000610352},
{647, -754.70001220703, 154.69999694824},
}

for k, v in ipairs(SwiatlaNaKominie) do
    local swiatla = createMarker(v[1], v[2], v[3], "corona", 0.55,255,0,0,255)
end


[ Dodano: 2017-08-22, 21:06 ]
Nie no dobra, mo?e troch? przesadzi?em...
Ale kto? wie jak zrobic, ?eby np. ?wiat?a mruga?y co 10 sekund ? Xd

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 00:46


.RiV







Wiek: 26
Na forum: 3729 dni
Posty: 554
Nick w MP: Split

Piwa: 2598

Respekt: 597,8
Respekt: 597,8

setTimer(function()
for k,v in pairs(getElementsByType("marker")) do
setMarkerColor(v, 255, 0, 0)
end
end, 10000, 0)


Podpis

Autor OGRPG, na scenie MTA od 2012 roku.




Użytkownik: 08.08.2016
GTAO Member: 06.02.2017
Support-Team: 17.06.2017 & 01.06.2019 - 18.11.2019
Moderator: 14.01.2018 - 09.08.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 08:44


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

ah.. mo?e to ?le sprecyzowa?em, ale nie chodzi mi o nag?e ZNIKNI?CIE, tylko POWOLNE ZANIKANIE takie fajny efekt ;d

Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 09:39


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

l3g3nd4,


Więcej informacji znajdziesz w Wikipedii MTA:


interpolateBetween


Powodzenia ;)

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 19:54


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

DZK :| nic z tego nie rozumiem, ju? chyba lepiej zrobie na setTimer'a xD

Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 19:57


neku^







Wiek: 24
Na forum: 3663 dni
Posty: 461
Nick w MP: neku^

Piwa: 1186

Respekt: 320,5
Respekt: 320,5Respekt: 320,5Respekt: 320,5

Czasami w ?yciu nie warto i?? na skr?ty :D masz na tym forum dwa poradniki o interpolateBetween powo

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 20:20


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

dbn69 wiem, ale ju? to zrobi?em z timer'em xd

Teraz jest taki te? ma?y problem, poniewa? PIERWSZY RAZ STWORZY?EM GUI W GUIEDITOR'rze i chcia?bym ?eby to gui otwiera?o si? jak sie wejdzie w marker, tak wiem, ?e "onMarkerHit itd" lecz PIERWSZY RAZ JESTEM W GUI. Chcia?bym te?, ?eby po naci?ni?ciu przycisku ((np. "pi?tro 5")) tepa?o nas na podane koordynaty, a po naci?ni?ciu przycisku (("Na ziemie")) tepa?o nas na d??.

Tutaj kod do gui

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientResourceStart", resourceRoot,
    function()
        GUIEditor.window[1] = guiCreateWindow(828, 377, 314, 210, "Wej?cie na wie?e", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "default-bold-small")
        GUIEditor.button[3] = guiCreateButton(174, 32, 130, 36, "Pi?tro 2", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[3], "default-bold-small")
        GUIEditor.button[4] = guiCreateButton(15, 87, 125, 37, "Pi?tro 3", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[4], "default-bold-small")
        GUIEditor.button[5] = guiCreateButton(174, 88, 130, 36, "Pi?tro 4", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[5], "default-bold-small")
        GUIEditor.button[6] = guiCreateButton(15, 148, 125, 38, "Pi?tro 5", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[6], "default-bold-small")
        GUIEditor.button[7] = guiCreateButton(174, 150, 130, 36, "Powr?t na ziemie", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[7], "default-bold-small")    
    end
)


Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 20:29


neku^







Wiek: 24
Na forum: 3663 dni
Posty: 461
Nick w MP: neku^

Piwa: 1186

Respekt: 320,5
Respekt: 320,5Respekt: 320,5Respekt: 320,5


GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onClientMarkerHit", getRootElement(),
    function(el)
      if localPlayer ~= el then return end -- blokada ?eby innym graczom nie pojawia?o si? GUI
        GUIEditor.window[1] = guiCreateWindow(828, 377, 314, 210, "Wej?cie na wie?e", false)
        guiWindowSetSizable(GUIEditor.window[1], false)

        GUIEditor.button[1] = guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false, GUIEditor.window[1])
        GUIEditor.button[2] = guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[2], "default-bold-small")
        GUIEditor.button[3] = guiCreateButton(174, 32, 130, 36, "Pi?tro 2", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[3], "default-bold-small")
        GUIEditor.button[4] = guiCreateButton(15, 87, 125, 37, "Pi?tro 3", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[4], "default-bold-small")
        GUIEditor.button[5] = guiCreateButton(174, 88, 130, 36, "Pi?tro 4", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[5], "default-bold-small")
        b6 = guiCreateButton(15, 148, 125, 38, "Pi?tro 5", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[6], "default-bold-small")
        GUIEditor.button[7] = guiCreateButton(174, 150, 130, 36, "Powr?t na ziemie", false, GUIEditor.window[1])
        guiSetFont(GUIEditor.button[7], "default-bold-small")    
    end
)

addEventHandler("onClientGUIClick", getRootElement (), function()
     if source == b6 then 
         setElementPosition(localPlayer, 0,0,3)
     end
end)

I przy on onmarkerhit musisz da? zamiast getRootElement element markera kt?ry stworzy?e?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 20:42


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

GUI w og?le si? nie otwiera gdy wchodz? w marker.

local wejscieNaWiezie = createMarker(646.29998779297, -754.70001220703, 44, "cylinder", 1.5, 247, 245, 7, 21)

GUIEditor = {
    button = {},
    window = {}
}
addEventHandler("onMarkerHit", wejscieNaWiezie,
    function(el)
      if localPlayer ~= el then return end -- blokada ?eby innym graczom nie pojawia?o si? GUI
        okno= guiCreateWindow(828, 377, 314, 210, "Wej?cie na wie?e", false)
        guiWindowSetSizable(okno, false)
        
        przycisk[1] = guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false, okno)
        guiSetFont(przycisk[1], "default-bold-small")
        
        przycisk[2] = guiCreateButton(174, 32, 130, 36, "Pi?tro 2", false, okno)
        guiSetFont(przycisk[2], "default-bold-small")
        
        przycisk[3] = guiCreateButton(15, 87, 125, 37, "Pi?tro 3", false, okno)
        guiSetFont(przycisk[3], "default-bold-small")
        
        przycisk[4] = guiCreateButton(174, 88, 130, 36, "Pi?tro 4", false, okno)
        guiSetFont(przycisk[4], "default-bold-small")
        
        przycisk[5] = guiCreateButton(15, 148, 125, 38, "Pi?tro 5", false, okno)
        guiSetFont(przycisk[5]        "default-bold-small")
        
        przycisk[6] = guiCreateButton(174, 150, 130, 36, "Powr?t na ziemie", false, okno)
        guiSetFont(przycisk[6], "default-bold-small")    
    end
)

addEventHandler("onClientGUIClick", getRootElement (), function()
     if source == przycisk6 then 
         setElementPosition(localPlayer, 0,0,3)
     end
end)


w DB3 nie ma ?adnego errora itd.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 21:23


Atroth







Wiek: 24
Na forum: 3818 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4813

Respekt: 540
Respekt: 540

l3g3nd4, Dlaczego tworzysz GUI za pomoc? "onMarkerHit", gdy? ta funkcja jest oparta na stronie serwera?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-08-23, 21:25


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3540 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

_Mike
Pisa?em, ?e PIERWSZY RAZ TWORZ? GUI...
Ale dzi?ki, spr?buje

[ Dodano: 2017-08-24, 16:42 ]
Okej GUI zrobi?em, lecz jak ?aduj? mape, to GUI si? pojawia jak nie b?d? w markerze
local wejscieNaWieze = createMarker(646.29998779297, -754.70001220703, 44, "cylinder", 1.5, 247, 245, 7, 21)
createBlipAttachedTo(wejscieNaWieze, 37, 1, 255, 0, 0, 255, 0, 200)


button={}
      
 windows = guiCreateWindow(828, 377, 314, 274, "Wej?cie na wie?e", false)
guiWindowSetSizable(windows, false)

button.P1= guiCreateButton(15, 32, 125, 36, "Pi?tro 1", false,  windows)
guiSetFont(button.P1, "default-bold-small")

button.P2 = guiCreateButton(174, 32, 130, 36, "Pi?tro 2", false,  windows)
guiSetFont(button.P2, "default-bold-small")

button.P3 = guiCreateButton(15, 87, 125, 37, "Pi?tro 3", false, windows)
guiSetFont(button.P3, "default-bold-small")

button.P4 = guiCreateButton(174, 88, 130, 36, "Pi?tro 4", false,  windows)
guiSetFont(button.P4, "default-bold-small")

button.P5= guiCreateButton(15, 148, 125, 38, "Pi?tro 5", false,  windows)
guiSetFont(button.P5, "default-bold-small")

button.PNZ= guiCreateButton(174, 150, 130, 36, "Powr?t na ziemie", false,  windows)
guiSetFont(button.PNZ, "default-bold-small")

button.zamknij = guiCreateButton(56, 207, 216, 46, "ZAMKNIJ GUI", false,  windows)
guiSetFont(button.zamknij,"default-bold-small")

function wlaczokno()
        guiSetVisible(windows, true)
    guiSetVisible(button.P1, true)
    guiSetVisible(button.P2, true)
    guiSetVisible(button.P3, true)
    guiSetVisible(button.P4, true)
    guiSetVisible(button.P5, true)
    guiSetVisible(button.PNZ, true)
    guiSetVisible(button.zamknij, true)
    showCursor(true)
    addEventHandler("onClientMarkerHit", wejscieNaWieze, wlaczokno)
end

function wylaczokno()
         guiSetVisible(windows, false)
    guiSetVisible(button.P1, false)
    guiSetVisible(button.P2, false)
    guiSetVisible(button.P3, false)
    guiSetVisible(button.P4, false)
    guiSetVisible(button.P5, false)
    guiSetVisible(button.PNZ, false)
    guiSetVisible(button.zamknij, false)
    showCursor(false)
    addEventHandler("onClientGUIClick", button.zamknij, wylaczokno)
end

function noelo()
addEventHandler("onClientGUIClick", button.P1)
         setElementPosition(localPlayer, 0,0,3)
end


META
    <script src="Komin.lua" type="client"/>


[ Dodano: 2017-08-24, 17:30 ]
Poradzi?em sobie !! MO?NA LOCK !!

Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Tagi: światła :: kominie.
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