Wysłany: 2015-09-07, 20:01
sebik2303
Mapper :)
Wiek: 25 Na forum: 4160 dni Posty: 298
Nick w MP: sebik2303
Piwa : 899
Witam, chcia?bym do tej bramy doda? funkcj? otwierania tylko z markera
bramaspidi = createObject ( 980 , - 503 , 2593 , 55.299999237061 , 0 , 0 , 270 )
function bramaotwspidi ( thePlayer )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "dom_177" )) then
moveObject ( bramaspidi , 6000 , - 503 , 2593 , 49.799999237061 )
outputChatBox ( "Trwa otwieranie bramy spidiego." , thePlayer , true )
end
end
addCommandHandler ( "odoms" , bramaotwspidi )
function bramazamspidi ( thePlayer )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "dom_177" )) then
moveObject ( bramaspidi , 6000 , - 503 , 2593 , 55.299999237061 )
outputChatBox ( "Trwa Zamykanie bramy spidiego." , thePlayer , true )
end
end
addCommandHandler ( "zdoms" , bramazamspidi )
Za pomoc daje
Wysłany: 2015-09-07, 20:13
Rudy.
Webmaster/LUA
Wiek: 27 Na forum: 4304 dni Posty: 43
Nick w MP: Rudy
Piwa : 1739
local gate ={
object = createObject ( 980 , - 503 , 2593 , 55.299999237061 , 0 , 0 , 270 )
marker = createMarker ( x , y , z - 1 , "cylinder" , 9 , 0 , 0 , 0 , 0 ),
closed = true ,
animation = false ,
}
gate . open =function()
if gate . animation or not gate . closed then return end
gate . animation = true
moveObject ( gate . object , 6000 , - 503 , 2593 , 49.799999237061 , "OutBounce" )
setTimer (function()
gate . animation = false ; gate . closed = false
end , 6000 , 1 )
end
gate . close =function()
if gate . animation or gate . closed then return end
gate . animation = true
moveObject ( gate . object , 6000 , - 503 , 2593 , 55.299999237061 , "OutBounce" )
setTimer (function()
gate . animation = false ; gate . closed = true
end , 6000 , 1 )
end
gate . toggle =function( el )
if not el then return end
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "dom_177" )) then
if gate . animation then
outputChatBox ( '* Poczekaj chwil?' , el , 143 , 5 , 5 )
return
end
if gate . closed then
gate . open ()
setTimer (function()
gate . close ()
end , 8000 , 1 )
end
else
outputChatBox ( "* Nie jeste? w?a?cicielem domu czy czego? tam ;3." , el , 255 , 0 , 0 )
end
end
addEventHandler ( "onMarkerHit" , gate . marker , function( el , md )
gate . toggle ( el )
end )
Spr?b?j tak.
Wysłany: 2015-09-07, 20:26
sebik2303
Mapper :)
Wiek: 25 Na forum: 4160 dni Posty: 298
Nick w MP: sebik2303
Piwa : 899
Rudy. , Przerobie cordy i powiem czy dzia?a
[ Dodano : 2015-09-07, 20:55 ]
Rudy. , wi?c ni za bardzo
dam kod co teraz zrobi?em.
P.S. to jest do SAPD i potrzebuj? 2 pary drzwi
local gate ={
drzwi1 = createObject ( 3089 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , 0 , 0 , 0 ),
drzwi2 = createObject ( 3089 , 2814.1796875 , 891.7998046875 , 11.10000038147 , 0 , 0 , 180 ),
marker = createMarker ( 2810.6999511719 , 891.90002441406 , 9.6000003814697 , "cylinder" , 3 , 0 , 0 , 0 , 0 ),
closed = true ,
animation = false
}
gate . open =function()
if gate . animation or not gate . closed then return end
gate . animation = true
moveObject ( gate . drzwi1 , 6000 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , "OutBounce" )
moveObject ( gate . drzwi2 , 6000 , 2815.7 , 891.7998046875 , 11.10000038147 , "OutBounce2" )
setTimer (function()
gate . animation = false ; gate . closed = false
end , 6000 , 1 )
end
gate . close =function()
if gate . animation or gate . closed then return end
gate . animation = true
moveObject ( gate . drzwi1 , 6000 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , "OutBounce" )
moveObject ( gate . drzwi2 , 6000 , 2814.1796875 , 891.7998046875 , 11.10000038147 , "OutBounce2" )
setTimer (function()
gate . animation = false ; gate . closed = true
end , 6000 , 1 )
end
gate . toggle =function( el )
if not el then return end
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( thePlayer )), aclGetGroup ( "SAPD" )) then
if gate . animation then
outputChatBox ( '* Poczekaj chwil?' , el )
return
end
end
end
if gate . closed then
gate . open ()
setTimer (function()
gate . close ()
end , 8000 , 1 )
else
outputChatBox ( "* Nie jeste? zatrudniony we Frakcji SAPD." , el )
end
addEventHandler ( "onMarkerHit" , gate . marker , function( el , md )
gate . toggle ( el )
end )
Wysłany: 2015-09-07, 20:58
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Więcej informacji znajdziesz w Wikipedii MTA: onMarkerHit
Wysłany: 2015-09-07, 20:58
sebik2303
Mapper :)
Wiek: 25 Na forum: 4160 dni Posty: 298
Nick w MP: sebik2303
Piwa : 899
Dodam i? robi? to na map Edytorze, wi?c mo?e dlatego nie dzia?a. Lecz jestem w grupie ACL SAPD
[ Dodano : 2015-09-07, 21:00 ]
+ ss db
Wysłany: 2015-09-08, 14:39
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
local marker = createMarker (- 503 , 2593 , 55.29999923706 , "cylinder" , 5 , 255 , 0 , 0 , 0 )
st = createObject ( 980 , - 503 , 2593 , 55.299999237061 , 0 , 0 , 270 )
function otwieranie ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "dom_177" )) then
moveObject ( st , 6000 , - 503 , 2593 , 49.799999237061 )
else
outputChatBox ( "Nie masz praw do otwierania drzwi." , thePlayer , 219 , 78 , 1 , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieranie )
function zamykanie ()
moveObject ( st , 6000 , - 503 , 2593 , 55.299999237061 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykanie )
Wysłany: 2015-09-08, 14:59
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-09-08, 23:06
sebik2303
Mapper :)
Wiek: 25 Na forum: 4160 dni Posty: 298
Nick w MP: sebik2303
Piwa : 899
Fanciak , Kod dzia?a, lecz gdy zrobi? 2 bram? i pozmieniam funkcj? to obydwie si? otwieraj?
Wysłany: 2015-09-09, 06:58
#404
Wiek: 26 Na forum: 4771 dni Posty: 1438
Piwa : 2512
sebik2303 , pozmieniaj nazwy takich zmiennych jak marker i to "st".
Wysłany: 2015-09-09, 11:35
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
local marker1 = createMarker (- 503 , 2593 , 55.29999923706 , "cylinder" , 5 , 255 , 0 , 0 , 0 )
st1 = createObject ( 980 , - 503 , 2593 , 55.299999237061 , 0 , 0 , 270 )
function otwieranie1 ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "dom_177" )) then
moveObject ( st1 , 6000 , - 503 , 2593 , 49.799999237061 )
else
outputChatBox ( "Nie masz praw do otwierania drzwi." , thePlayer , 219 , 78 , 1 , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieranie1 )
function zamykanie1 ()
moveObject ( st1 , 6000 , - 503 , 2593 , 55.299999237061 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykanie1 )
Pozmieniaj se pozycje i id bramy i leci.
Wysłany: 2015-09-09, 17:32
sebik2303
Mapper :)
Wiek: 25 Na forum: 4160 dni Posty: 298
Nick w MP: sebik2303
Piwa : 899
Fanciak , nadal to samo
dam ca?y kod:
-->> Wej ? cie / wyj ? cie <--
local marker = createMarker ( 2810.6999511719 , 891.90002441406 , 9.8000001907349 , "cylinder" , 1.5 , 255 , 0 , 0 , 0 )
st = createObject ( 3089 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , 0 , 0 , 0 )
st1 = createObject ( 3089 , 2814.1796875 , 891.7998046875 , 11.10000038147 , 0 , 0 , 180 )
function otwieraniewej ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st , 3000 , 2809.6 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 3000 , 2815.7 , 891.7998046875 , 11.10000038147 )
else
outputChatBox ( "* Nie jeste? zatrudniony we Frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieraniewej )
function zamykaniewej ()
moveObject ( st , 6000 , 2811.2001953125 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 6000 , 2814.1796875 , 891.7998046875 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykaniewej )
-->> recepcja <--
local marker1 = createMarker ( 2819 , 883.5 , 9.8000001907349 , "cylinder" , 1.5 , 255 , 0 , 0 , 0 )
st3 = createObject ( 3089 , 2816.7998046875 , 883.5 , 11.10000038147 , 0 , 0 , 0 )
function otwieranierec ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st3 , 3000 , 2815.3 , 883.5 , 11.10000038147 )
else
outputChatBox ( "* Nie jeste? zatrudniony we Frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieranierec )
function zamykanierec ()
moveObject ( st3 , 6000 , 2816.7998046875 , 883.5 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykanierec )
Dodam i? to s? 2 bramy
Wysłany: 2015-09-09, 18:25
Barcioo
Kiedyś to było ST
Wiek: 26 Na forum: 4048 dni Posty: 458
Nick w MP: Bartek.
Piwa : 1887
zr?b z mojego kodu tylko pozmnaj tam i skopuj i dodaj tam np 1 bedzie git
Podpis
Kanał Youtube;
A tu zapraszam
[you]
, pomogłem Ci? Wynagrodź mnie
SUPPORT TEAM - 2016-09-03 do 2018-05-25
Test Mod - 2018-05-25
1k dni na Forum - 2018-01-28
GG: 62111935
Wysłany: 2015-09-09, 18:57
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Troszke poprawilem, dodalem estetyke. U mnie na lokalu wszystko smiga:
----------------------------------------->> Wejscie / wyjscie <-----------------------------------------------------------
local marker = createMarker ( 2810.6999511719 , 891.90002441406 , 9.8000001907349 , "cylinder" , 3 , 255 , 0 , 0 , 0 )
st = createObject ( 3089 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , 0 , 0 , 0 )
st1 = createObject ( 3089 , 2814.1796875 , 891.7998046875 , 11.10000038147 , 0 , 0 , 180 )
function otwieraniewej ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st , 3000 , 2809.6 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 3000 , 2815.7 , 891.7998046875 , 11.10000038147 )
else
outputChatBox ( "* Nie jestes zatrudniony w frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieraniewej )
function zamykaniewej ()
moveObject ( st , 3000 , 2811.2001953125 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 3000 , 2814.1796875 , 891.7998046875 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykaniewej )
------------------------------------>> recepcja <-----------------------------------------------------------------------
local marker1 = createMarker ( 2819 , 883.5 , 9.8000001907349 , "cylinder" , 3 , 255 , 0 , 0 , 0 )
st3 = createObject ( 3089 , 2816.7998046875 , 883.5 , 11.10000038147 , 0 , 0 , 0 )
function otwieranierec ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st3 , 3000 , 2815.3 , 883.5 , 11.10000038147 )
else
outputChatBox ( "* Nie jestes zatrudniony we frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieranierec )
function zamykanierec ()
moveObject ( st3 , 3000 , 2816.7998046875 , 883.5 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykanierec )
Musi dzialac.
Wysłany: 2015-09-15, 16:56
Tomeg123
Wiek: 32 Na forum: 4067 dni Posty: 26
Piwa : 83
"Fanciak" napisał/a :Troszke poprawilem, dodalem estetyke. U mnie na lokalu wszystko smiga:
----------------------------------------->> Wejscie / wyjscie <-----------------------------------------------------------
local marker = createMarker ( 2810.6999511719 , 891.90002441406 , 9.8000001907349 , "cylinder" , 3 , 255 , 0 , 0 , 0 )
st = createObject ( 3089 , 2811.2001953125 , 891.7998046875 , 11.10000038147 , 0 , 0 , 0 )
st1 = createObject ( 3089 , 2814.1796875 , 891.7998046875 , 11.10000038147 , 0 , 0 , 180 )
function otwieraniewej ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st , 3000 , 2809.6 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 3000 , 2815.7 , 891.7998046875 , 11.10000038147 )
else
outputChatBox ( "* Nie jestes zatrudniony w frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieraniewej )
function zamykaniewej ()
moveObject ( st , 3000 , 2811.2001953125 , 891.7998046875 , 11.10000038147 )
moveObject ( st1 , 3000 , 2814.1796875 , 891.7998046875 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykaniewej )
------------------------------------>> recepcja <-----------------------------------------------------------------------
local marker1 = createMarker ( 2819 , 883.5 , 9.8000001907349 , "cylinder" , 3 , 255 , 0 , 0 , 0 )
st3 = createObject ( 3089 , 2816.7998046875 , 883.5 , 11.10000038147 , 0 , 0 , 0 )
function otwieranierec ( hitElement )
if isObjectInACLGroup ( "user." .. getAccountName ( getPlayerAccount ( hitElement )), aclGetGroup ( "SAPD" )) then
moveObject ( st3 , 3000 , 2815.3 , 883.5 , 11.10000038147 )
else
outputChatBox ( "* Nie jestes zatrudniony we frakcji SAPD." , thePlayer , true )
end
end
addEventHandler ( "onMarkerHit" , getRootElement (), otwieranierec )
function zamykanierec ()
moveObject ( st3 , 3000 , 2816.7998046875 , 883.5 , 11.10000038147 )
end
addEventHandler ( "onMarkerLeave" , getRootElement (), zamykanierec )
Musi dzialac.
Podpinam si?, skrypt dzia?a. Mo?na by prosi? jak?? podpowied?, chcia?bym zrobi?, gdy wejd? w marker to brama si? przesuwa, gdy wejd? PONOWNIE to dopiero si? zamyka. Bo "onMarketLeave" wskazuje, ?e gdy wyjd? z markeru to brama si? zamknie, a ja chcia?bym aby po kolejnym wej?ciu si? zamkn??a. Argumenty np. "if brama.otwarta then" pomog??
Wysłany: 2015-09-15, 18:25
Fanciak
BOT
Wiek: 25 Na forum: 4446 dni Posty: 728
Nick w MP: Fanciak
Piwa : 1572
Tagi: brama :: otwierana :: markerze.
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: