Wysłany: 2020-03-16, 12:50
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Witam mam tutaj kod na teleportacje gracza po wej?ciu w marker jak to mog? przerobi? by sprawnie dzia?a?o tak.
Je?eli gracz jest w markerze i kliknie dany przycisk to dopiero wykona si? teleportacja na dane miejsce.
kod
wejscie_marker = createMarker (- 1885.15 , - 1636.43 , 21.75 - 0.95 , "arrow" , 1.4 , 255 , 199 , 0 , 80 )
addEventHandler ( "onMarkerHit" , wejscie_marker , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
setElementFrozen ( el , true )
setTimer (function ()
triggerClientEvent ( el , "showInfo" , el , "Wszed?e?/a?\ndo Kopalni." , "info" )
setElementDimension ( el , 1 )
setElementPosition ( el , - 1913.37 , - 1633.68 , - 45.75 )
setElementFrozen ( el , false )
showPlayerHudComponent ( el , "radar" , true )
end , 500 , 1 )
end )
Wysłany: 2020-03-16, 13:12
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
Więcej informacji znajdziesz w Wikipedii MTA: bindKey
albo
Więcej informacji znajdziesz w Wikipedii MTA: onClientKey
i wtedy
Wysłany: 2020-03-16, 16:46
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
Wilq zrobi?em tak, lecz mam taki b??d w db3 i nwm jak go naprawi?
kod
if bindKey ( el , "e" , "down" ) then
addEventHandler ( "onMarkerHit" , wejscie_marker , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
setElementFrozen ( el , true )
setTimer (function ()
triggerClientEvent ( el , "showInfo" , el , "Wszed?e?/a?\ndo Kopalni." , "info" )
setElementDimension ( el , 1 )
setElementPosition ( el , - 1913.37 , - 1633.68 , - 45.75 )
setElementFrozen ( el , false )
showPlayerHudComponent ( el , "radar" , true )
end , 500 , 1 )
end )
end
b??d w DB3
Bad argument @ 'bindKey' [ Expected player at argument 1 , got nil ]
Wysłany: 2020-03-16, 17:19
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
bindKey to po prostu funkcja, w niej zr?b funkcj? kt?r? masz w evencie od markera.
Wysłany: 2020-03-16, 23:54
Pyrek24
Wiek: 25 Na forum: 3438 dni Posty: 546
Nick w MP: Pyrek
Piwa : 10
co? takiego ?
bindKey (function( el , md ), "e" , "down" ) then
Wysłany: 2020-03-17, 07:29
Wilq
Wiek: 24 Na forum: 4428 dni Posty: 3410
Piwa : 739
To ma by? po prostu funkcja, ?aden warunek sprawdzaj?cy.
Więcej szczegółów
Wystawiono 1 piw(a):Pyrek24
Tagi: keybindy
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: