Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2015-09-07, 20:01


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

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 :piwo: :piwo: :piwo: :piwo:

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-07, 20:13


Rudy.

Webmaster/LUA






Wiek: 27
Na forum: 4445 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
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.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-07, 20:26


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-07, 20:58


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500


Więcej informacji znajdziesz w Wikipedii MTA:

createMarker



Więcej informacji znajdziesz w Wikipedii MTA:

onMarkerHit



Więcej informacji znajdziesz w Wikipedii MTA:

onMarkerLeave


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-07, 20:58


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

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


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-08, 14:39


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

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)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-08, 14:59


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4190 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1892

Respekt: 460
Respekt: 460

masz m?j skrypt i zmie? sobie to linik http://gtao.pl/<font-c...a-b-vt97913.htm

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-08, 23:06


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

Fanciak, Kod dzia?a, lecz gdy zrobi? 2 bram? i pozmieniam funkcj? to obydwie si? otwieraj? :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-09, 06:58


#404







Wiek: 27
Na forum: 4913 dni
Posty: 1438

Piwa: 2512

Respekt: 833,5
Respekt: 833,5Respekt: 833,5

Ostrzeżeń: 60%
sebik2303, pozmieniaj nazwy takich zmiennych jak marker i to "st".

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-09, 11:35


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

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.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-09, 17:32


sebik2303

Mapper :)






Wiek: 25
Na forum: 4301 dni
Posty: 298
Nick w MP: sebik2303

Piwa: 899

Respekt: 55,3

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 :)

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-09, 18:25


Barcioo

Kiedyś to było ST






Wiek: 26
Na forum: 4190 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1892

Respekt: 460
Respekt: 460

zr?b z mojego kodu tylko pozmnaj tam i skopuj i dodaj tam np 1 bedzie git

Podpis
Kanał Youtube;
A tu zapraszam
, pomogłem Ci? Wynagrodź mnie :piwo: :)


SUPPORT TEAM- 2016-09-03 do 2018-05-25
Test Mod- 2018-05-25
1k dni na Forum - 2018-01-28


GG: 62111935
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-09, 18:57


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

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.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-15, 16:56


Tomeg123







Wiek: 32
Na forum: 4209 dni
Posty: 26

Piwa: 83

Respekt: 80

Ostrzeżeń: 100%
"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??

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-09-15, 18:25


Fanciak

BOT






Wiek: 26
Na forum: 4587 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

Tomeg123, tak - pomoga.

Postaw piwo autorowi tego posta
 

 
Tagi: brama :: otwierana :: markerze.
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Brama otwierana w markerze. Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

Nie możesz pisać nowych tematów
Nie możesz odpowiadać w tematach
Nie możesz zmieniać swoich postów
Nie możesz usuwać swoich postów
Nie możesz głosować w ankietach
Dodaj temat do Ulubionych
Wersja do druku