Wysłany: 2017-10-13, 17:09
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
Tak jak w tytule..
A mianowicie potrzebuj? zrobi? TELEPORT NA BINDKEY'a lecz nie wiem jak si? za to zabra?
Mam co? takiego
local wejscie = createMarker ( 1568.5999755859 , - 1689.5999755859 , 6.5999999046326 , "arrow" , 1 , 243 , 246 , 22 , 138 )
local wyjscie = createMarker ( 1565.5 , - 1676.4000244141 , 3448.6000976563 , "arrow" , 1 , 243 , 246 , 22 , 138 )
function TeleportDoInterioru ( player )
if getElementType ( player )== "player" then
if source == wejscie then
setElementPosition ( player , 1565.42249 , - 1677.86597 , 3448.26245 )
setElementInterior ( player , 0 )
setElementInterior ( wyjscie , 0 )
setElementFrozen ( player , true )
setTimer ( setElementFrozen , 2000 , 1 , player , false )
end
end
end
addEventHandler ( "onMarkerHit" , wejscie , TeleportDoInterioru )
function WyjscieZInterioru ( player )
if getElementType ( player )== "player" then
if source == wyjscie then
setElementPosition ( player , 1568.52307 , - 1691.57178 , 5.89063 )
setElementInterior ( player , 0 )
setElementFrozen ( player , true )
setTimer ( setElementFrozen , 2000 , 1 , player , false )
end
end
end
addEventHandler ( "onMarkerHit" , wyjscie , WyjscieZInterioru ) [/u]
Wysłany: 2017-10-13, 17:46
Qbiszon
Map editor
Wiek: 25 Na forum: 4176 dni Posty: 29
Nick w MP: Qbi
Piwa : 2
Robisz bindKey'a i potem sprawdzasz czy gracz jest w markerze.
Więcej informacji znajdziesz w Wikipedii MTA: bindKey
Wysłany: 2017-10-13, 17:58
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
A jaki? przyk?ad mo?na ?
Wysłany: 2017-10-13, 18:04
Qbiszon
Map editor
Wiek: 25 Na forum: 4176 dni Posty: 29
Nick w MP: Qbi
Piwa : 2
Jasne,
bindKey ( "e" , "down" , function()
if not isElementWithinMarker ( localPlayer , marker ) then return end
end )
i uzupe?niasz sobie jak chcesz.
Wysłany: 2017-10-13, 18:11
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
Ale przyk?ad taki, w s?sie z tym kodem *UP* xd
Bo tak mam b??dy w DB3
[skrypty]\tp\col.lua:35: Bad argument @ 'bindKey' [Expected player at argument 1, got string 'e']
bindKey ( "e" , "down" , function()
if not isElementWithinMarker ( localPlayer , wyjscie ) then return end
end )
Podpis
Discord: l3g3nd4#9882
GG: 66391457
Wysłany: 2017-10-13, 18:29
Qbiszon
Map editor
Wiek: 25 Na forum: 4176 dni Posty: 29
Nick w MP: Qbi
Piwa : 2
Masz gotowca bo widz?, ?e nic nie rozumiesz z tego.
Przerobi?em ten tw?j skrypt na c-side.
local wejscie = createMarker ( 1568.5999755859 , - 1689.5999755859 , 6.5999999046326 , "arrow" , 1 , 243 , 246 , 22 , 138 )
local wyjscie = createMarker ( 1565.5 , - 1676.4000244141 , 3448.6000976563 , "arrow" , 1 , 243 , 246 , 22 , 138 )
bindKey ( "e" , "down" , function()
if not isElementWithinMarker ( localPlayer , wejscie ) then return end
if getElementType ( localPlayer )== "player" then
setElementPosition ( localPlayer , 1565.42249 , - 1677.86597 , 3448.26245 )
setElementInterior ( localplayer , 0 )
setElementInterior ( localplayer , 0 )
setElementFrozen ( localplayer , true )
setTimer ( setElementFrozen , 2000 , 1 , localplayer , false )
end
end )
bindKey ( "e" , "down" , function()
if not isElementWithinMarker ( localPlayer , wyjscie ) then return end
if getElementType ( localPlayer )== "player" then
setElementPosition ( localplayer , 1568.52307 , - 1691.57178 , 5.89063 )
setElementInterior ( localplayer , 0 )
setElementFrozen ( localplayer , true )
setTimer ( setElementFrozen , 2000 , 1 , localplayer , false )
end
end )
Wysłany: 2017-10-13, 18:39
l3g3nd4
Mapper & Modeler
Wiek: 22 Na forum: 3399 dni Posty: 156
Nick w MP: l3g3nd4
Piwa : 602
okej dzk <3
Mo?na lock
Podpis
Discord: l3g3nd4#9882
GG: 66391457
Wysłany: 2017-10-13, 19:47
Atroth
Wiek: 23 Na forum: 3677 dni Posty: 1089
Nick w MP: Atroth
Piwa : 4808
Dodam od siebie, ?e nic gotowcami nie zyska Qbiszon . Problemem kodu l3g3nd4 , jest to, ?e kod Qbiszon jest napisany po stronie clienta, a Ty da?e? kod po stronie servera.
Tagi: teleport :: bindkeya :: pomocy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: