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

Wysłany: 2017-10-13, 17:09


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3399 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

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.59997558596.5999999046326"arrow"1243,246,22,138)
local wyjscie createMarker(1565.5, -1676.40002441413448.6000976563"arrow"1243,246,22,138)

function TeleportDoInterioru(player)
if getElementType(player)=="player" then
if source == wejscie then
setElementPosition(player1565.42249, -1677.865973448.26245)
setElementInterior(player0)
setElementInterior(wyjscie0)
setElementFrozen(playertrue)
setTimer(setElementFrozen,2000,1,player,false)
end
end
end
addEventHandler("onMarkerHit"wejscieTeleportDoInterioru)

function WyjscieZInterioru(player)
if getElementType(player)=="player" then
if source == wyjscie then
setElementPosition(player1568.52307, -1691.571785.89063setElementInterior(player0)
setElementFrozen(playertrue)
setTimer(setElementFrozen,2000,1,player,false)
end
end
end
addEventHandler("onMarkerHit"wyjscieWyjscieZInterioru)
[/u]

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 17:46


Qbiszon

Map editor






Wiek: 25
Na forum: 4176 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Robisz bindKey'a i potem sprawdzasz czy gracz jest w markerze.


Więcej informacji znajdziesz w Wikipedii MTA:

bindKey


Więcej informacji znajdziesz w Wikipedii MTA:

isElementWithinMarker


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 17:58


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3399 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

A jaki? przyk?ad mo?na ? :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 18:04


Qbiszon

Map editor






Wiek: 25
Na forum: 4176 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

Jasne,


bindKey("e""down", function()
    if not isElementWithinMarker(localPlayermarkerthen return end

end)


i uzupe?niasz sobie jak chcesz.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 18:11


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3399 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

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(localPlayerwyjsciethen return end

end)


Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 18:29


Qbiszon

Map editor






Wiek: 25
Na forum: 4176 dni
Posty: 29
Nick w MP: Qbi

Piwa: 2

Respekt: 50

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.59997558596.5999999046326"arrow"1243,246,22,138)
local wyjscie createMarker(1565.5, -1676.40002441413448.6000976563"arrow"1243,246,22,138)


bindKey("e""down", function()
    if not isElementWithinMarker(localPlayerwejsciethen return end
if getElementType(localPlayer)=="player" then
setElementPosition(localPlayer1565.42249, -1677.865973448.26245)
setElementInterior(localplayer0)
setElementInterior(localplayer0)
setElementFrozen(localplayertrue)
setTimer(setElementFrozen,2000,1,localplayer,false)
end
end)


bindKey("e""down", function()
    if not isElementWithinMarker(localPlayerwyjsciethen return end
if getElementType(localPlayer)=="player" then
setElementPosition(localplayer1568.52307, -1691.571785.89063setElementInterior(localplayer0)
setElementFrozen(localplayertrue)
setTimer(setElementFrozen,2000,1,localplayer,false)
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 18:39


l3g3nd4

Mapper & Modeler






Wiek: 22
Na forum: 3399 dni
Posty: 156
Nick w MP: l3g3nd4

Piwa: 602

Respekt: 95,3

okej dzk <3
Mo?na lock

Podpis

Discord: l3g3nd4#9882
GG: 66391457
Postaw piwo autorowi tego posta
 

 
Wysłany: 2017-10-13, 19:47


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

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.

Postaw piwo autorowi tego posta
 

 
Tagi: teleport :: bindkeya :: pomocy
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