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

Wysłany: 2016-07-26, 11:38


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
elo , mam problem , gdy? jak jest 2 graczy w markerze t oich nie teleportuje , pomo?ecie ?
function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker"then
        return false
    end
    local markerColShape getElementColShape(marker)
    local elements getElementsWithinColShape(markerColShape"player")
    return elements
end
local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder"local elementy getElementsWithinMarker(marker)
if #elementy==2 then -- tutaj da?em 2 poniewa? ma tepa? 2 graczy na raz i ?eby nie tepa?o tylko 1 gracza 
setElementPosition(elementy,2143.238041547.5225810.82031)
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 11:43


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

MartinPanZycia, funkcja getElementsWithinMarker zwraca tabele.
local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder"local elementy getElementsWithinMarker(marker)
if #elementy==2 then -- tutaj da?em 2 poniewa? ma tepa? 2 graczy na raz i ?eby nie tepa?o tylko 1 gracza 
    for iv in ipairs (elementy) do
        setElementPosition(v,2143.238041547.5225810.82031)
    end
end


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 14:28


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
nadal nie dzia?a , i tepa ale tylko jak zrestartuje ten skrypt to tepa graczy 2 co s? w markerze .
A fajnie by by?o gdyby bez restartowania skryptu tepa?o ich . Co? poradzisz ?

Podpis
Cześć w MTA jestem jako Rodzaje.
Wszystko jest po staremu nie zamierzam stawiać RPG.
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 14:51


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

MartinPanZycia, bo nie u?y?e? eventu ehh:
local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder") 

function markerHit ()
if not source == marker then return end
local elementy getElementsWithinMarker(marker)
    if #elementy==2 then -- tutaj da?em 2 poniewa? ma tepa? 2 graczy na raz i ?eby nie tepa?o tylko 1 gracza 
        for iv in ipairs (elementy) do
            setElementPosition(v,2143.238041547.5225810.82031)
        end
    end
end
addEventHandler"onMarkerHit"markermarkerHit )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 16:16


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
nadal tak samo , moe ja le edytowa[list]em , zobacz sam .
function getElementsWithinMarker(marker)
    if (not isElement(marker) or getElementType(marker) ~= "marker"then
        return false
    end
    local markerColShape getElementColShape(marker)
    local elements getElementsWithinColShape(markerColShape"player")
    return elements
end
local marker createMarker(1821.38318, -1683.3321513.38281 "cylinder")
 
function markerHit ()
if not source == marker then return end
local elementy getElementsWithinMarker(marker)
    if #elementy==2 then -- tutaj da?em 2 poniewa? ma tepa? 2 graczy na raz i ?eby nie tepa?o tylko 1 gracza 
        for iv in ipairs (elementy) do
            setElementPosition(v,2143.238041547.5225810.82031)
        end
    end
end
addEventHandler"onMarkerHit"markermarkerHit )


Ostatnio zmieniony przez MartinPanZycia 2016-07-26, 16:25, w całości zmieniany 1 raz  
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 16:24


luki123luki123

Place Game






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

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611

Jak to ma dzia?a? ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-07-26, 16:25


MartinPanZycia

Zielony w LUA






Wiek: 27
Na forum: 3729 dni
Posty: 476
Nick w MP: Rodzaje

Piwa: 878

Respekt: 70,5

Ostrzeżeń: 40%
?e dw?ch graczy wchodzi w marker i ich teleportuje w okre?lone miejsce .

Postaw piwo autorowi tego posta
 

 
Tagi: marker2
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