Wysłany: 2018-01-08, 20:37
sabarupl
Wiek: 43 Na forum: 4825 dni Posty: 347
Piwa : 163
Mam taki kod jak poni?ej. Potrzebuje zrobi? du?o takich teleport?w i tak si? zastawiam czy jest mo?liwo?? zapisania tego kodu jako? kr?cej?
wejscie_1 = createMarker ( 1022.48846 , - 1122.03687 , 24.87156 , "arrow" , 1.5 , 0 , 255 , 64 , 100 )
wyjscie_1 = createMarker ( 1110.789 , - 1166.434 , 1487.359 , "arrow" , 1.5 , 255 , 255 , 0 , 170 )
setElementInterior ( wyjscie_1 , 3 )
setElementDimension ( wyjscie_1 , 3 )
addEventHandler ( "onMarkerHit" , wejscie_1 , function( player , md )
if isPedInVehicle ( player ) then return end
setElementPosition ( player , 1110.789 , - 1165.096 , 1486.559 )
setElementDimension ( player , 3 )
setElementInterior ( player , 3 )
setCameraTarget ( player )
end )
addEventHandler ( "onMarkerHit" , wyjscie_1 , function( player , md )
if isPedInVehicle ( player ) then return end
setElementDimension ( player , 0 )
setElementInterior ( player , 0 )
setElementPosition ( player , 1022.41669 , - 1124.56250 , 23.87010 )
setCameraTarget ( player )
end )
Ostatnio zmieniony przez sabarupl 2018-01-08, 21:24, w całości zmieniany 1 raz
Wysłany: 2018-01-08, 20:55
Kalizman
Wiek: 23 Na forum: 3651 dni Posty: 1394
Piwa : 4619
Np.poprzez tabel? nie b?dzie milion kopiowania addEventHandler... itp.
Wysłany: 2018-01-08, 21:24
sabarupl
Wiek: 43 Na forum: 4825 dni Posty: 347
Piwa : 163
Wysłany: 2018-01-08, 23:26
THEGizmo
Modeler/Uczeń Lua
Wiek: 27 Na forum: 4141 dni Posty: 255
Nick w MP: THEGizmo
Piwa : 3072
Licze na
lub
powinno dzia?a? dobrze, pisane na szybko.
local pozycjeTeleportow = {
-- Marker wejscie x , y , z | tp wejscie x , y , z dim , int || Marker wyjscie x , y , z | tp wyjscia x , y , z , dim , int
{ 1022.48 , - 1122.03 , 24.87 , 1022.41 , - 1124.56 , 23.87 , 0 , 0 , 1110.78 , - 1166.43 , 1487.35 , 1110.78 , - 1165.09 , 1486.55 , 3 , 3 },
}
for i , v in pairs ( pozycjeTeleportow ) do
local markerWejscie = createMarker ( v [ 1 ], v [ 2 ], v [ 3 ], "arrow" , 1.5 , 255 , 255 , 0 , 170 )
setElementDimension ( markerWejscie , v [ 7 ])
setElementInterior ( markerWejscie , v [ 8 ])
local markerWyjscie = createMarker ( v [ 9 ], v [ 10 ], v [ 11 ], "arrow" , 1.5 , 255 , 255 , 0 , 170 )
setElementDimension ( markerWyjscie , v [ 15 ])
setElementInterior ( markerWyjscie , v [ 16 ])
function teleportWejscie ( el , md )
if getElementType ( el ) == "player" then
if isPedInVehicle ( el ) then return end
setElementDimension ( el , v [ 15 ])
setElementInterior ( el , v [ 16 ])
setElementPosition ( el , v [ 12 ], v [ 13 ], v [ 14 ])
end
end
addEventHandler ( "onMarkerHit" , markerWejscie , teleportWejscie )
function teleportWyjscie ( el , md )
if getElementType ( el ) == "player" then
if isPedInVehicle ( el ) then return end
setElementDimension ( el , v [ 7 ])
setElementInterior ( el , v [ 8 ])
setElementPosition ( el , v [ 4 ], v [ 5 ], v [ 6 ])
end
end
addEventHandler ( "onMarkerHit" , markerWyjscie , teleportWyjscie )
end
Podpis
Modeler Corporation Sp. Z.O.O
Tagi: krótszy :: sposób :: zapisania :: kodu?
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: