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

Wysłany: 2014-09-25, 20:39


maxerxxl







Wiek: 31
Na forum: 5208 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
Witam, zrobi?em sobie prac? ?mieciarza problem tkwi w tym ?e nie mog? zrobi? ?eby z tablicy wszystkie punkty si? pokazywa?y i jak wjad? w wybrany z nich usuwa si? marker, pr?bowa?em, bawi?em si? ale nie mog? si? z tym upora?.

addEventHandler("onVehicleEnter", root, function(player, seat, jacked)
    if getElementData(source, "smieciarka") == 1 then
        if seat==0 then
            setElementFrozen(source, false)
            setElementData(source, "smieciarka_ladunek", 0)
            setElementData(source, "pojazd_opis", "Zape?nienie: 0%")
            outputChatBox("* Rozpocz??e? prac? jako Smieciarz!", player)
            for i in pairs(Punkty) do
                marker = createMarker(Punkty[i] [1], Punkty[i] [2],  Punkty[i] [3], "cylinder", 6, 0, 0, 255)

            addEventHandler("onMarkerHit", marker, function(el)
                destroyElement(marker[i])
            end)
            end
        end
    end
end)


// brat starszy maxerxxl, pozwolenie na za?o?enie tematu

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-25, 21:14


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

nie ma czego? takiego jak "for i in ipairs[...]"


Przyk?ad jak to zrobi? ( wzi?te z mojego prawo jazdy ) :

addEventHandler ( "onClientMarkerHit", root, function ( element )
    if source == marker then
        if element == localPlayer then
            if getElementData ( element, "PrawoJazdy:B" ) then return outputChatBox ( "Posiadasz ju? Prawo Jazdy Kat.B!", 255, 255, 255 ) end
                if liczba == #miejsca then
                hp = getElementHealth ( getPedOccupiedVehicle ( element ) )
                return triggerServerEvent ( "koniecEgzaminu", element, tonumber(hp) ) end
            if liczba == 0 then
                outputChatBox ( "Zacz??e? egzamin Prawa Jazdy Kategoria B.", 255, 255, 255 )
                triggerServerEvent ( "onPlayerStart", localPlayer )
            end
            liczba = liczba + 1
            marker = createMarker ( miejsca[liczba][1], miejsca[liczba][2], miejsca[liczba][3], "checkpoint", 1.5, 255, 0, 0 )
            destroyElement ( source )
        end
    end
    addEvent ( "onPlayerDestroyMarker", true )
    addEventHandler ( "onPlayerDestroyMarker", root, function ()
        if source == localPlayer then
            destroyElement ( marker )
            liczba = 0
            marker = createMarker ( -102.2421875, 1231.9173583984, 21.94800567627, "cylinder", 5, 255, 255, 255, 0, 0 )
        end
    end)
end)


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-25, 21:28


maxerxxl







Wiek: 31
Na forum: 5208 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
ale mi chodzi aby wszystkie markery kt?re mam dodane w tablicy "Punkty" pokazywa?y si? na mapie i jak wjad? w jaki? z nich marker znika ten w kt?ry wjecha?em.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-25, 21:37


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Ah wybacz


markery = {
{ x,y,z }
}


for _,v in ipairs ( markery ) do
    marker = createMarker ( v[1], v[2], v[3], "cylinder", 1.5, 255, 255, 255 )
    setElementData ( marker, "wartosc", true )
end


addEventHandler ( "onMarkerHit", marker, function ()
    if getElementData ( source, "wartosc" ) then
        destroyElement ( source )
    end
end)


Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-25, 21:53


maxerxxl







Wiek: 31
Na forum: 5208 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
niestety pierwszy marker jeden marker znika po wjechaniu w niego, ale ten drugi ju? nie.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-26, 06:46


MeeShuffle

Programista/Grafik






Wiek: 33
Na forum: 4535 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8578

Respekt: 535,3
Respekt: 535,3

Spr?buj bez warunku if getElementData[...]

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2014-09-26, 14:46


maxerxxl







Wiek: 31
Na forum: 5208 dni
Posty: 285
Nick w MP: MaXI

Piwa: 38

Respekt: 45,3

Ostrzeżeń: 100%
nadal znika pierwszy marker kt?ry jest dodany w tablicy ale drugi ju? nie

Postaw piwo autorowi tego posta
 

 
Tagi: praca :: smieciarza
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