Wysłany: 2020-08-05, 16:38
Kezoto [Usunięty ]
Szukam ciagle na wiki mta setplayeridle setplayerwalk run itp ale nie umiem znalezc jak sie nazywa funkcja aby wylaczyc bieganie dla local player, ktos moze na szybko mi ja podac i zamknac temat?
Wysłany: 2020-08-05, 17:06
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
setPedControlState, o to ci chodzi?o? Bo je?li chcesz wy??czy? bieganie to toggleControl.
Wysłany: 2020-08-05, 17:34
Kezoto [Usunięty ]
[lua] toggleControl ( source, "jump", false ) [/lua] dobrze to jest? bo mi nie dziala
[ Dodano : 2020-08-05, 17:36 ]
sprobowalem tez z localPlayer [lua] toggleControl ( localPlayer, "sprint", true )
[/lua] ale takze nie dziala
[ Dodano : 2020-08-05, 17:45 ]
sprobowalem takze: [lua] controls = {"jump", "sprint", "crouch", "enter_exit", "enter_passenger"}
toggleControl(player, control, false) [/lua]
a no dalej nie dziala
Wysłany: 2020-08-05, 18:39
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
Pokaz kod gdzie to umiesciles?
Wysłany: 2020-08-05, 18:53
Kezoto [Usunięty ]
nie chce umieszczac w watku publicznym prywatnego kodu nad ktorym pracuje wiec chcialbym takze to zrobic w markerze dlatego:
[lua] controls = {"jump", "sprint", "crouch", "enter_exit", "enter_passenger"}
local text4=createElement("text")
setElementPosition(text4,2178.97, -2255.47, 14.77)
setElementData(text4,"name","Wejscie do magazynu")
local text4=createElement("text")
setElementPosition(text4,2193.20, -2217.47, -15.21)
setElementData(text4,"name","Wyjscie z magazynu")
wejscie42 = createMarker(2179.15, -2255.76, 14.77-1, "cylinder", 1.2, 0, 122, 255)
setElementData(wejscie42, 'typ', 'drzwi')
wyjscie42 = createMarker(2193.50, -2217.35, -15.19-1, "cylinder", 1.2, 0, 122, 255)
setElementData(wyjscie42, 'typ', 'drzwi')
addEventHandler("onMarkerHit", wejscie42, function(el,md)
if getElementType(el) ~= "player" then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
toggleControl(player, control, false)
setTimer(function ()
setElementInterior(el,0)
setElementDimension(el,0)
setElementFrozen(el,false)
setElementPosition(el,2196.53, -2217.69, -15.26)
setElementFrozen(el, false)
fadeCamera(el, true)
end, 1500, 1)
end)
addEventHandler("onMarkerHit", wyjscie42, function(el,md)
if getElementType(el) ~= "player" then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
toggleControl(player, control, true)
setTimer(function ()
setElementDimension(el, 0)
setElementInterior(el, 0)
setElementFrozen(el,false)
setElementPosition(el,2180.60, -2257.03, 14.77)
setElementFrozen(el, false)
fadeCamera(el, true)
end, 1500, 1)
end)
[/lua]
[ Dodano : 2020-08-05, 18:54 ]
[lua] controls = {"jump", "sprint", "crouch", "enter_exit", "enter_passenger"}
local text4=createElement("text")
setElementPosition(text4,2178.97, -2255.47, 14.77)
setElementData(text4,"name","Wejscie do magazynu")
local text4=createElement("text")
setElementPosition(text4,2193.20, -2217.47, -15.21)
setElementData(text4,"name","Wyjscie z magazynu")
wejscie42 = createMarker(2179.15, -2255.76, 14.77-1, "cylinder", 1.2, 0, 122, 255)
setElementData(wejscie42, 'typ', 'drzwi')
wyjscie42 = createMarker(2193.50, -2217.35, -15.19-1, "cylinder", 1.2, 0, 122, 255)
setElementData(wyjscie42, 'typ', 'drzwi')
addEventHandler("onMarkerHit", wejscie42, function(el,md)
if getElementType(el) ~= "player" then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
toggleControl(localPlayer, control, false)
setTimer(function ()
setElementInterior(el,0)
setElementDimension(el,0)
setElementFrozen(el,false)
setElementPosition(el,2196.53, -2217.69, -15.26)
setElementFrozen(el, false)
fadeCamera(el, true)
end, 1500, 1)
end)
addEventHandler("onMarkerHit", wyjscie42, function(el,md)
if getElementType(el) ~= "player" then return end
if isPedInVehicle(el) then return end
fadeCamera(el ,false)
setElementFrozen(el, true)
toggleControl(localPlayer, control, true)
setTimer(function ()
setElementDimension(el, 0)
setElementInterior(el, 0)
setElementFrozen(el,false)
setElementPosition(el,2180.60, -2257.03, 14.77)
setElementFrozen(el, false)
fadeCamera(el, true)
end, 1500, 1)
end)
[/lua]
Wysłany: 2020-08-05, 19:00
VVirmex
Sgrypter luja
Wiek: 21 Na forum: 3365 dni Posty: 281
Nick w MP: AxyZ
Piwa : 234
controls = { "jump" , "sprint" , "crouch" , "enter_exit" , "enter_passenger" }
local text4 = createElement ( "text" )
setElementPosition ( text4 , 2178.97 , - 2255.47 , 14.77 )
setElementData ( text4 , "name" , "Wejscie do magazynu" )
local text4 = createElement ( "text" )
setElementPosition ( text4 , 2193.20 , - 2217.47 , - 15.21 )
setElementData ( text4 , "name" , "Wyjscie z magazynu" )
wejscie42 = createMarker ( 2179.15 , - 2255.76 , 14.77 - 1 , "cylinder" , 1.2 , 0 , 122 , 255 )
setElementData ( wejscie42 , 'typ' , 'drzwi' )
wyjscie42 = createMarker ( 2193.50 , - 2217.35 , - 15.19 - 1 , "cylinder" , 1.2 , 0 , 122 , 255 )
setElementData ( wyjscie42 , 'typ' , 'drzwi' )
addEventHandler ( "onMarkerHit" , wejscie42 , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
fadeCamera ( el , false )
setElementFrozen ( el , true )
toggleControl ( localPlayer , controls , false )
setTimer (function ()
setElementInterior ( el , 0 )
setElementDimension ( el , 0 )
setElementFrozen ( el , false )
setElementPosition ( el , 2196.53 , - 2217.69 , - 15.26 )
setElementFrozen ( el , false )
fadeCamera ( el , true )
end , 1500 , 1 )
end )
addEventHandler ( "onMarkerHit" , wyjscie42 , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
fadeCamera ( el , false )
setElementFrozen ( el , true )
toggleControl ( localPlayer , controls , true )
setTimer (function ()
setElementDimension ( el , 0 )
setElementInterior ( el , 0 )
setElementFrozen ( el , false )
setElementPosition ( el , 2180.60 , - 2257.03 , 14.77 )
setElementFrozen ( el , false )
fadeCamera ( el , true )
end , 1500 , 1 )
end )
Sprawa jest taka, ?e na pocz?tku napisa?e? controls, a p??niej napisa?e? control.
Zmieni?em ci to w kodzie powy?ej, zobacz czy teraz zadzia?a.
[ Dodano : 2020-08-05, 19:02 ]
A je?eli dalej nie zadzia?a, to wtedy zamie? z false na true, i true na false (w obydw?ch miejscach)
Wysłany: 2020-08-05, 19:07
Kezoto [Usunięty ]
wkleilem kod , nie dzialalo, zamienilem to takze nie dzialalo
Wysłany: 2020-08-05, 19:10
VVirmex
Sgrypter luja
Wiek: 21 Na forum: 3365 dni Posty: 281
Nick w MP: AxyZ
Piwa : 234
To spr?buj wszystkie controlsy oddzielnie wypisa?.
Wysłany: 2020-08-05, 20:35
MeeShuffle
Programista/Grafik
Wiek: 32 Na forum: 4394 dni Posty: 2758
Nick w MP: Shuffle
Piwa : 8575
VVirmex , przesta? mu ?le doradza? bo sie ch?opak pogubi.
jak chcesz pobra? 1 linijk? wiele warto?ci naraz bez p?tli?
Jak chcesz u?y? wielu warto?ci w tabeli robisz takie co?
controls = { "jump" , "sprint" , "crouch" , "enter_exit" , "enter_passenger" }
local text4 = createElement ( "text" )
setElementPosition ( text4 , 2178.97 , - 2255.47 , 14.77 )
setElementData ( text4 , "name" , "Wejscie do magazynu" )
local text4 = createElement ( "text" )
setElementPosition ( text4 , 2193.20 , - 2217.47 , - 15.21 )
setElementData ( text4 , "name" , "Wyjscie z magazynu" )
wejscie42 = createMarker ( 2179.15 , - 2255.76 , 14.77 - 1 , "cylinder" , 1.2 , 0 , 122 , 255 )
setElementData ( wejscie42 , 'typ' , 'drzwi' )
wyjscie42 = createMarker ( 2193.50 , - 2217.35 , - 15.19 - 1 , "cylinder" , 1.2 , 0 , 122 , 255 )
setElementData ( wyjscie42 , 'typ' , 'drzwi' )
addEventHandler ( "onMarkerHit" , wejscie42 , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
fadeCamera ( el , false )
setElementFrozen ( el , true )
for _ , v in ipairs ( controls )do
toggleControl ( localPlayer , v , false )
end
setTimer (function ()
setElementInterior ( el , 0 )
setElementDimension ( el , 0 )
setElementFrozen ( el , false )
setElementPosition ( el , 2196.53 , - 2217.69 , - 15.26 )
setElementFrozen ( el , false )
fadeCamera ( el , true )
end , 1500 , 1 )
end )
addEventHandler ( "onMarkerHit" , wyjscie42 , function( el , md )
if getElementType ( el ) ~= "player" then return end
if isPedInVehicle ( el ) then return end
fadeCamera ( el , false )
setElementFrozen ( el , true )
for _ , v in ipairs ( controls )do
toggleControl ( localPlayer , v , true )
end
setTimer (function ()
setElementDimension ( el , 0 )
setElementInterior ( el , 0 )
setElementFrozen ( el , false )
setElementPosition ( el , 2180.60 , - 2257.03 , 14.77 )
setElementFrozen ( el , false )
fadeCamera ( el , true )
end , 1500 , 1 )
end )
A co do 2 eventow, podpowiem ci ze mozna zrobi? to pro?ciej. onMarkerHit w source zwraca marker w kt?ry si? wesz?o, wi?c mo?esz w jednym evencie zrobi? pare marker?w, pro?ciej wygodniej szybciej i optymalniej.
Example :
marker1 = createMarker
marker2 = createMarker
marker3 = createMarker
addEventHandler ( "onMarkerHit" , root ,function()
if source == marker1 then
-- kod
elseif source == marker2 then
-- kod
elseif source == marker3 then
-- kod
end
end )
Wysłany: 2020-08-05, 23:07
Kezoto [Usunięty ]
do zamkniecia sam ogarnalem juz to
Tagi: krotko :: temat :: potrzebuje :: nazwy :: funkcji
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: