Wysłany: 2016-09-01, 18:39
karat1
Wiek: 24 Na forum: 3758 dni Posty: 95
Nick w MP: Karatos
Piwa : 4
Witajcie mam do was pytanie jak zrobi? drzwi na 2 markery o to kod
--]] Autor skryptu : Patrix
-- W bindach pomaga ?: Atex
-- W animacji pomaga ?: Emm
-- Zakaz zmiany autora ![[--
bm = createMarker ( 2383.78 , - 1668.60 , 13.54 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
bm = createMarker ( 2384.30 , - 1670.83 , 14.55 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d = createObject ( 3089 , 2383.89 , - 1669 , 13.89 , 0 , 0 , 0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SAPD" )) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 3089 , 2382.39 , - 1669 , 13.89 ) -- Koordy otwartych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
function zd ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) then
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SAPD" )) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 3089 , 2383.89 , - 1669 , 13.89 ) -- koordy zamknietych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
addCommandHandler ( "od" , od ) -- haslo otwartych drzwi
addCommandHandler ( "zd" , zd ) -- haslo zamknietych drzwi
addEventHandler ( "onPlayerJoin" , root ,function()
bindKey ( source , "mouse_wheel_down" , "both" , animka )
bindKey ( source , "mouse_wheel_up" , "both" , animka2 )
bindKey ( source , "mouse_wheel_down" , "both" , od )
bindKey ( source , "mouse_wheel_up" , "both" , zd )
end )
addEventHandler ( "onResourceStart" , resourceRoot , function()
for k , v in ipairs ( getElementsByType ( "player" )) do
bindKey ( v , "mouse_wheel_down" , "both" , animka )
bindKey ( v , "mouse_wheel_up" , "both" , animka2 )
bindKey ( v , "mouse_wheel_down" , "both" , od )
bindKey ( v , "mouse_wheel_up" , "both" , zd )
end
end
)
[ Komentarz dodany przez: AteX : 2016-09-01, 18:40 ]
Stosuj znaczniki [lua][/lua]
Ostatnio zmieniony przez AteX 2016-09-01, 18:39, w całości zmieniany 1 raz
Wysłany: 2016-09-01, 20:36
marcin778
Krytyk serwerów MTA
Wiek: 24 Na forum: 4149 dni Posty: 2268
Nick w MP: Marcineg
Piwa : 4662
--]] Autor skryptu : Patrix
-- W bindach pomaga ?: Atex
-- W animacji pomaga ?: Emm
-- Zakaz zmiany autora ![[--
bm = createMarker ( 2383.78 , - 1668.60 , 13.54 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
bm2 = createMarker ( 2384.30 , - 1670.83 , 14.55 , "cylinder" , 1.0 , 0 , 0 , 0 , 255 ) -- gdzie ma byc marker w ktorym bedzie sie scrollowac
d = createObject ( 3089 , 2383.89 , - 1669 , 13.89 , 0 , 0 , 0 ) -- podajesz koordy obiektu
local kategoria_animacji = "CRIB"
local animacja = "CRIB_Use_Switch"
function od ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) or isElementWithinMarker ( thePlayer , bm2 ) then
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SAPD" )) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 3089 , 2382.39 , - 1669 , 13.89 ) -- Koordy otwartych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
function zd ( thePlayer )
if isElementWithinMarker ( thePlayer , bm ) or isElementWithinMarker ( thePlayer , bm2 ) then
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SAPD" )) then -- Tutaj zmieniasz tylko "Policja"
moveObject ( d , 3089 , 2383.89 , - 1669 , 13.89 ) -- koordy zamknietych drzwi
setTimer ( setPedAnimation , 1066.66 , 1 , thePlayer )
setPedAnimation ( thePlayer , kategoria_animacji , animacja , true , false , false )
end
end
end
addCommandHandler ( "od" , od ) -- haslo otwartych drzwi
addCommandHandler ( "zd" , zd ) -- haslo zamknietych drzwi
addEventHandler ( "onPlayerJoin" , root ,function()
bindKey ( source , "mouse_wheel_down" , "both" , animka )
bindKey ( source , "mouse_wheel_up" , "both" , animka2 )
bindKey ( source , "mouse_wheel_down" , "both" , od )
bindKey ( source , "mouse_wheel_up" , "both" , zd )
end )
addEventHandler ( "onResourceStart" , resourceRoot , function()
for k , v in ipairs ( getElementsByType ( "player" )) do
bindKey ( v , "mouse_wheel_down" , "both" , animka )
bindKey ( v , "mouse_wheel_up" , "both" , animka2 )
bindKey ( v , "mouse_wheel_down" , "both" , od )
bindKey ( v , "mouse_wheel_up" , "both" , zd )
end
end
)
Wysłany: 2016-09-01, 21:44
karat1
Wiek: 24 Na forum: 3758 dni Posty: 95
Nick w MP: Karatos
Piwa : 4
Tagi: drzwi :: scrolla
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: