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: 4160 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 createObject980, -503259355.29999923706100270)

function bramaotwspidi (thePlayer)
if isObjectInACLGroup "user."..getAccountName(getPlayerAccount(thePlayer)), aclGetGroup("dom_177")) then
moveObject bramaspidi6000, -503259349.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 bramaspidi6000, -503259355.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: 4304 dni
Posty: 43
Nick w MP: Rudy

Piwa: 1739

Respekt: 25,8

Ostrzeżeń: 40%
local gate={
    object=createObject(980, -503259355.29999923706100270)
    marker=createMarker(x,y,z-1"cylinder"90000),
    closed=true,
    animation=false,
}

gate.open=function()
    if gate.animation or not gate.closed then return end

    gate.animation=true
    moveObject(gate.object6000, -503259349.799999237061"OutBounce")
        
    setTimer(function()
        gate.animation=falsegate.closed=false
    end60001)
end

gate.close=function()
    if gate.animation or gate.closed then return end

    gate.animation=true
    moveObject(gate.object6000, -503259355.299999237061"OutBounce")
        
    setTimer(function()
        gate.animation=falsegate.closed=true
    end60001)
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?'el14355)
            return
        end

        if gate.closed then
            gate.open()

            setTimer(function()
                gate.close()
            end80001)
        end
    else
        outputChatBox("* Nie jeste? w?a?cicielem domu czy czego? tam ;3."el25500)
    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: 4160 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(30892811.2001953125891.799804687511.10000038147000),
    drzwi2=createObject(30892814.1796875891.799804687511.1000003814700180),
    marker=createMarker(2810.6999511719891.900024414069.6000003814697"cylinder"30000),
    closed=true,
    animation=false
}


gate.open=function()
    if gate.animation or not gate.closed then return end

    gate.animation=true
    moveObject(gate.drzwi160002811.2001953125891.799804687511.10000038147"OutBounce")
    moveObject(gate.drzwi260002815.7891.799804687511.10000038147"OutBounce2")
        
    setTimer(function()
        gate.animation=falsegate.closed=false
    end60001)
end
gate.close=function()
    if gate.animation or gate.closed then return end

    gate.animation=true
    moveObject(gate.drzwi160002811.2001953125891.799804687511.10000038147"OutBounce")
    moveObject(gate.drzwi260002814.1796875891.799804687511.10000038147"OutBounce2")
        
    setTimer(function()
        gate.animation=falsegate.closed=true
    end60001)
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()
            end80001)
       
    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: 25
Na forum: 4446 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: 4160 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: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

local marker createMarker(-503259355.29999923706"cylinder"5255000)

    st createObject 980, -503259355.29999923706100270 ) 
    function otwieranie (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("dom_177"))then
            moveObject st6000, -503259349.799999237061 ) 
            else
        outputChatBox ("Nie masz praw do otwierania drzwi."thePlayer219781true )
       end
    end 
    addEventHandler("onMarkerHit",getRootElement(),otwieranie)

    function zamykanie () 
        moveObject st6000, -503259355.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: 4048 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

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: 4160 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: 26
Na forum: 4771 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: 25
Na forum: 4446 dni
Posty: 728
Nick w MP: Fanciak

Piwa: 1572

Respekt: 500
Respekt: 500

local marker1 createMarker(-503259355.29999923706"cylinder"5255000)

    st1 createObject 980, -503259355.29999923706100270 ) 
    function otwieranie1 (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("dom_177"))then
            moveObject st16000, -503259349.799999237061 ) 
            else
        outputChatBox ("Nie masz praw do otwierania drzwi."thePlayer219781true )
       end
    end 
    addEventHandler("onMarkerHit",getRootElement(),otwieranie1)

    function zamykanie1 () 
        moveObject st16000, -503259355.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: 4160 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.6999511719891.900024414069.8000001907349"cylinder"1.5255000)

    st=createObject(30892811.2001953125891.799804687511.10000038147000)
    st1=createObject(30892814.1796875891.799804687511.1000003814700180)
    function otwieraniewej (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st30002809.6891.799804687511.10000038147 ) 
            moveObject st130002815.7891.799804687511.10000038147 ) 
            else
        outputChatBox ("* Nie jeste? zatrudniony we Frakcji SAPD."thePlayertrue )
       end
    end
    addEventHandler("onMarkerHit",getRootElement(),otwieraniewej)

    function zamykaniewej () 
        moveObject st60002811.2001953125891.799804687511.10000038147 )
        moveObject st160002814.1796875891.799804687511.10000038147 )
    end 
    addEventHandler("onMarkerLeave",getRootElement(),zamykaniewej)
    -->> recepcja <--

local marker1 createMarker(2819883.59.8000001907349"cylinder"1.5255000)

    st3 createObject(30892816.7998046875883.511.10000038147000)
    function otwieranierec (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st330002815.3883.511.10000038147 ) 
            else
        outputChatBox ("* Nie jeste? zatrudniony we Frakcji SAPD."thePlayertrue )
       end
    end 
    addEventHandler("onMarkerHit",getRootElement(),otwieranierec)

    function zamykanierec () 
        moveObject st360002816.7998046875883.511.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: 4048 dni
Posty: 458
Nick w MP: Bartek.

Piwa: 1887

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: 25
Na forum: 4446 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.6999511719891.900024414069.8000001907349"cylinder"3255000)

    st=createObject(30892811.2001953125891.799804687511.10000038147000)
    st1=createObject(30892814.1796875891.799804687511.1000003814700180)
    function otwieraniewej (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st30002809.6891.799804687511.10000038147 ) 
            moveObject st130002815.7891.799804687511.10000038147 ) 
            else
        outputChatBox ("* Nie jestes zatrudniony w frakcji SAPD."thePlayertrue )
       end
    end
    addEventHandler("onMarkerHit"getRootElement(), otwieraniewej)

    function zamykaniewej () 
        moveObject st30002811.2001953125891.799804687511.10000038147 )
        moveObject st130002814.1796875891.799804687511.10000038147 )
    end 
    addEventHandler("onMarkerLeave"getRootElement(), zamykaniewej)
    
    
 ------------------------------------>> recepcja <-----------------------------------------------------------------------

local marker1 createMarker(2819883.59.8000001907349"cylinder"3255000)
st3 createObject(30892816.7998046875883.511.10000038147000)


    function otwieranierec (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st330002815.3883.511.10000038147 ) 
            else
        outputChatBox ("* Nie jestes zatrudniony we frakcji SAPD."thePlayertrue )
       end
    end 
    addEventHandler("onMarkerHit"getRootElement(), otwieranierec)

    function zamykanierec () 
        moveObject st330002816.7998046875883.511.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: 4067 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.6999511719891.900024414069.8000001907349"cylinder"3255000)

    st=createObject(30892811.2001953125891.799804687511.10000038147000)
    st1=createObject(30892814.1796875891.799804687511.1000003814700180)
    function otwieraniewej (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st30002809.6891.799804687511.10000038147 ) 
            moveObject st130002815.7891.799804687511.10000038147 ) 
            else
        outputChatBox ("* Nie jestes zatrudniony w frakcji SAPD."thePlayertrue )
       end
    end
    addEventHandler("onMarkerHit"getRootElement(), otwieraniewej)

    function zamykaniewej () 
        moveObject st30002811.2001953125891.799804687511.10000038147 )
        moveObject st130002814.1796875891.799804687511.10000038147 )
    end 
    addEventHandler("onMarkerLeave"getRootElement(), zamykaniewej)
    
    
 ------------------------------------>> recepcja <-----------------------------------------------------------------------

local marker1 createMarker(2819883.59.8000001907349"cylinder"3255000)
st3 createObject(30892816.7998046875883.511.10000038147000)


    function otwieranierec (hitElement)
    if isObjectInACLGroup("user."..getAccountName(getPlayerAccount(hitElement)),aclGetGroup("SAPD"))then
            moveObject st330002815.3883.511.10000038147 ) 
            else
        outputChatBox ("* Nie jestes zatrudniony we frakcji SAPD."thePlayertrue )
       end
    end 
    addEventHandler("onMarkerHit"getRootElement(), otwieranierec)

    function zamykanierec () 
        moveObject st330002816.7998046875883.511.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: 25
Na forum: 4446 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