Wysłany: 2017-07-05, 12:58
tomadr123
Wiek: 25 Na forum: 3344 dni Posty: 21
Nick w MP: tomadr123
Piwa : 1
Witam, mam problem z kodem, nie chce mi bindowa? automatycznie hase? do bramek. bm = createMarker ( 2326.2 , 2525.88086 , 1028.81396 , "cylinder" , 1.0 , 0 , 0 , 0 , 0 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d = createObject ( 3089 , 2326.1000976563 , 2523.8999023438 , 1029.0999755859 , 0 , 0 , 90 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function isPlayerInPoliceFaction ( plr )
local uid = getElementData ( plr , 'player:uid' )
if not uid then return end
local result = exports [ 'ogrpg-db' ]: dbGet ( 'SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;' , "SAPD" , uid )
if result [ 1 ] then
return true
else
return false
end
end
function od7 ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isPlayerInPoliceFaction ( Policja ) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 2500 , 2326.1000976563 , 2522.4 , 1029.0999755859 ) -- Koordy otwartych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
function zd7 ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isPlayerInPoliceFaction ( Policja ) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 2500 , 2326.1000976563 , 2523.8999023438 , 1029.0999755859 ) -- koordy zamknietch drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
addCommandHandler ( "od7" , od7 ) -- haslo otwartych drzwi
addCommandHandler ( "zd7" , zd7 ) -- haslo zamknietych drzwi
addEventHandler ( "onPlayerJoin" , root ,function()
bindKey ( source , "mouse_wheel_down" , od7 )
bindKey ( source , "mouse_wheel_up" , zd7 )
end )
function onStart ()
for k , source in pairs ( getElementsByType ( "player" )) do
bindKey ( source , "mouse_wheel_down" , od7 )
bindKey ( source , "mouse_wheel_up" , zd7 )
end
end
addEventHandler ( "onResourceStart" , root , onStart )
Stawiam oraz
Wysłany: 2017-07-05, 16:16
tomadr123
Wiek: 25 Na forum: 3344 dni Posty: 21
Nick w MP: tomadr123
Piwa : 1
No i dalej to samo
Kod: [2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi6.lua:38: Bad argument @ 'addCommandHandler' [Expected function at argument 2, got nil]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi6.lua:39: Bad argument @ 'addCommandHandler' [Expected function at argument 2, got nil]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi.lua:50: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi2.lua:48: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi2.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi3.lua:48: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi3.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi4.lua:48: Bad argument @ 'bindKe
y' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi4.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi5.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi5.lua:50: Bad argument @ 'bindKey' [Expected string at argument 3, got function]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi6.lua:48: Bad argument @ 'bindKey' [Expected string at argument 3, got nil]
[2017-07-05 16:15] WARNING: [pystories]/[skrypty]/[frakcje]/pys-sapd-scroll/drzwi6.lua:49: Bad argument @ 'bindKey' [Expected string at argument 3, got nil]
Wysłany: 2017-07-05, 16:21
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
Nie uwzgl?dni?e? argumentu 'keyState' czyli czy dana rzecz ma si? dzia? po wci?ni?ciu przycisku "down" czy po puszczeniu "up" czy w momencie gdy go trzyma "both".
bm = createMarker ( 2326.2 , 2525.88086 , 1028.81396 , "cylinder" , 1.0 , 0 , 0 , 0 , 0 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d = createObject ( 3089 , 2326.1000976563 , 2523.8999023438 , 1029.0999755859 , 0 , 0 , 90 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function isPlayerInPoliceFaction ( plr )
local uid = getElementData ( plr , 'player:uid' )
if not uid then return end
local result = exports [ 'ogrpg-db' ]: dbGet ( 'SELECT 1 FROM ogrpg_factions WHERE code=? AND uid=? LIMIT 1;' , "SAPD" , uid )
if result [ 1 ] then
return true
else
return false
end
end
function od7 ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isPlayerInPoliceFaction ( Policja ) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 2500 , 2326.1000976563 , 2522.4 , 1029.0999755859 ) -- Koordy otwartych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
function zd7 ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isPlayerInPoliceFaction ( Policja ) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 2500 , 2326.1000976563 , 2523.8999023438 , 1029.0999755859 ) -- koordy zamknietch drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
addCommandHandler ( "od7" , od7 ) -- haslo otwartych drzwi
addCommandHandler ( "zd7" , zd7 ) -- haslo zamknietych drzwi
addEventHandler ( "onPlayerJoin" , root ,function()
bindKey ( source , "mouse_wheel_down" , "both" , od7 )
bindKey ( source , "mouse_wheel_up" , "both" , zd7 )
end )
function onStart ()
for k , source in pairs ( getElementsByType ( "player" )) do
bindKey ( source , "mouse_wheel_down" , "both" , od7 )
bindKey ( source , "mouse_wheel_up" , "both" , zd7 )
end
end
addEventHandler ( "onResourceStart" , root , onStart )
Więcej szczegółów
Wystawiono 1 piw(a):tomadr123
Wysłany: 2017-07-05, 17:19
tomadr123
Wiek: 25 Na forum: 3344 dni Posty: 21
Nick w MP: tomadr123
Piwa : 1
Dobra temat uwa?am za rozwi?zany, prosz? o zamkni?cie
Tagi: bramki
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: