Wysłany: 2016-07-26, 11:38
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
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.33215 , 13.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.23804 , 1547.52258 , 10.82031 )
end
Wysłany: 2016-07-26, 11:43
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
MartinPanZycia , funkcja getElementsWithinMarker zwraca tabele.
local marker = createMarker ( 1821.38318 , - 1683.33215 , 13.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 i , v in ipairs ( elementy ) do
setElementPosition ( v , 2143.23804 , 1547.52258 , 10.82031 )
end
end
Wysłany: 2016-07-26, 14:28
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
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.
Wysłany: 2016-07-26, 14:51
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
MartinPanZycia , bo nie u?y?e? eventu ehh:
local marker = createMarker ( 1821.38318 , - 1683.33215 , 13.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 i , v in ipairs ( elementy ) do
setElementPosition ( v , 2143.23804 , 1547.52258 , 10.82031 )
end
end
end
addEventHandler ( "onMarkerHit" , marker , markerHit )
Wysłany: 2016-07-26, 16:16
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
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.33215 , 13.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 i , v in ipairs ( elementy ) do
setElementPosition ( v , 2143.23804 , 1547.52258 , 10.82031 )
end
end
end
addEventHandler ( "onMarkerHit" , marker , markerHit )
Ostatnio zmieniony przez MartinPanZycia 2016-07-26, 16:25, w całości zmieniany 1 raz
Wysłany: 2016-07-26, 16:24
luki123luki123
Place Game
Wiek: 28 Na forum: 5275 dni Posty: 1948
Nick w MP: LuKiO
Piwa : 6101
Wysłany: 2016-07-26, 16:25
MartinPanZycia
Zielony w LUA
Wiek: 27 Na forum: 3728 dni Posty: 476
Nick w MP: Rodzaje
Piwa : 878
?e dw?ch graczy wchodzi w marker i ich teleportuje w okre?lone miejsce .
Tagi: marker2
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: