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

Wysłany: 2018-06-25, 21:18


adisonboss







Wiek: 23
Na forum: 3472 dni
Posty: 237

Piwa: 6

Respekt: 50

Witam mam problem z brama na marker ot?? pojawia mi si? brama oraz marker ale wcale si? nie otwiera za pomoc oczywi?cie R* i :piwo:

-----------------------------------------------------------------------------------------------------------------------------------
-- @name: System Bram
-- @author: LuKiO
-- @date: 11-08-2015
-- @version: 1.0.0
-- @info: Zakaz zmiany autora skryptu
-- @For: Gtao.pl
---------------------------------------------------------
bramy = {}
bramy[1] = {x=xxx, y=xxx, z=xxx, z2=xxx, rot=xxx, id=xxx, rozmiar=xxx, acl=xxx }

----*xxx - wype?niij
----Przyk?ad
----bramy[1] = {x=-1631.8000488281, y=688.40002441406, z=8.6999998092651, z2=3, rot=270, id=10184, rozmiar=10, acl="Policja" }

data = {}
data.max = 1 --//Ilosc bram 

brama = {} --//Tabela bram
maker = {} --//Tabela marker?w

function createBrama () --Tworzenie bram
    for i=1, data.max do --P?tla do pobierania ilosci bram
    brama[i] = createObject ( 5422, -127.40, 1033.90, 20.79, 0, 0, 90) --//Tworzebie objektu(Brama)
    maker[i] = createMarker(-124.50101, 1035.11816, 19, 'cylinder', 1.5, 0, 255, 0, 75) --//Tworzebie Markeru
    outputDebugString( "Storzono brame o id "..i)
    end
end
addEventHandler( "onResourceStart", getRootElement(), createBrama)

function Wjedz(hitPlayer) --Wchodzenie do bramy 
    for i=0, data.max do --P?tla do pobierania ilosci bram
        if source == maker[i] then --Sprawdzanie czy marker jest markerem bramy
            if getElementType( hitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz = getPlayerName( hitPlayer ) -- Pobieranie Nazwy gracza
                local konto = getAccountName( getPlayerAccount( hitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup( 'user.'..konto, aclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje si? w acl
                    moveObject ( 5422, 10000, 127.40, 1033.90,  16.40)
                    outputChatBox( "● Otworzy?e? brame o id: "..i, hitPlayer, 0,255,255, true)
                    outputDebugString( "Otwieranie bramy o id "..i.." przez "..gracz.."" )
                end
            end
        end
        
    end    
end
addEventHandler ( "onMarkerHit", getRootElement(), Wjedz )

function Wyjedz(hitPlayer) -- Wychodzenie z bramy
    for i=0, data.max do --P?tla do pobierania ilosci bram
        if source == maker[i] then --Sprawdzanie czy marker jest markerem bramy
            if getElementType( hitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz = getPlayerName( hitPlayer ) -- Pobieranie Nazwy gracza
                local konto = getAccountName( getPlayerAccount( hitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup( 'user.'..konto, aclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje si? w acl
                    moveObject ( 5422, 10000,-127.40, 1033.90, 20.79, 0, 0, 90)
                    outputChatBox( "● Zamkn??e? brame o id: "..i, hitPlayer, 0,255,255, true)
                    outputDebugString( "Zamkni?cie bramy o id "..i.." przez "..gracz.."" )
                end
            end
        end    
    end
end
addEventHandler ( "onMarkerLeave", getRootElement(), Wyjedz )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-25, 22:11


nanKy







Wiek: 23
Na forum: 4006 dni
Posty: 498
Nick w MP: nanky

Piwa: 1775

Respekt: 239
Respekt: 239Respekt: 239

Zmie?

 if isObjectInACLGroup( 'user.'..konto, aclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje si? w acl

na

                if isObjectInACLGroup( 'user.'..konto, aclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje si? w acl


Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-26, 07:16


adisonboss







Wiek: 23
Na forum: 3472 dni
Posty: 237

Piwa: 6

Respekt: 50

Dobra zrobi? tak ale wtedy jak mam zrobi? by tylko ACL OSP mog?o otwiera? t? bram??

[ Dodano: 2018-06-26, 11:23 ]
Nie dzia?a brama nadal si? nie rusza.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-26, 12:13


Malentas

Koder mirofali w lua






Wiek: 24
Na forum: 3822 dni
Posty: 146
Nick w MP: Malentas

Piwa: 1633

Respekt: 47,3

Prosz?, "troche" poprawi?em kod nie testowa?em lecz powinno dzia?a?


local bramy = {
    --{kordy bramy, rot bramy, kordy markeru, aclgrup}
    {-127.40, 1033.90, 20.79, 90, -124.50101, 1035.11816, 19, "OSP"},
}

local maks = 0

for i, v in ipairs(bramy) do
    brama = createObject(5422, v[1], v[2], v[3], 0, 0, v[4])
    marker = createMarker(v[5], v[6], v[7], "cylinder", 1.5, 255, 0, 0, 255)
    setElementData(marker, "frakcja", v[8])
    setElementData(marker, "kordy", v[1]..","..v[2]..","..v[3])
    addEventHandler("onMarkerHit", marker, markerHit)
    addEventHandler ( "onMarkerLeave", marker, markerLeave)
    maks = maks+1
end

function markerHit(player)
    if getElementType(player) == "player" then
        local gracz = getPlayerName(player)
        local konto = getAccountName(getPlayerAccount(player))
        if isObjectInACLGroup( 'user.'..konto, aclGetGroup(getElementData(source, "frakcja"))) then
            local kordy = split(getElementData(source, "kordy"), ",")
            moveObject(5422, 10000, kordy[1], kordy[2], kordy[3]-4)
            outputChatBox("Otworzy?e? brame", player, 0, 255, 255)
        end
    end  
end

function markerLeave(hitPlayer)
     if getElementType(player) == "player" then
        local gracz = getPlayerName(player)
        local konto = getAccountName(getPlayerAccount(player))
        if isObjectInACLGroup( 'user.'..konto, aclGetGroup(getElementData(source, "frakcja"))) then
            local kordy = split(getElementData(source, "kordy"), ",")
            moveObject(5422, 10000, kordy[1], kordy[2], kordy[3]+4)
            outputChatBox("Zamkn??e? brame", player, 0, 255, 255)
        end
    end  
end


Podpis
Aktualny projekt:


AntoriaMTA
Discord: https://discord.gg/TVrAddp3Wu

Najszybszy kontakt (discord): Malentas#2091
Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-29, 15:53


adisonboss







Wiek: 23
Na forum: 3472 dni
Posty: 237

Piwa: 6

Respekt: 50

Nie wiem dlaczego ale nadal ten skrypt nie dzia?a

Postaw piwo autorowi tego posta
 

 
Wysłany: 2018-06-29, 15:58


PatryKK.

Emeryt LUA






Wiek: 27
Na forum: 3202 dni
Posty: 1059
Nick w MP: PatryKK.

Piwa: 2331

Respekt: 331,5
Respekt: 331,5Respekt: 331,5Respekt: 331,5


-----------------------------------------------------------------------------------------------------------------------------------
-- @name: System Bram
-- @author: LuKiO
-- @date: 11-08-2015
-- @version: 1.0.0
-- @info: Zakaz zmiany autora skryptu
-- @For: Gtao.pl
---------------------------------------------------------
bramy = {}
bramy[1] = {x=xxx, y=xxx, z=xxx, z2=xxx, rot=xxx, id=xxx, rozmiar=xxx, acl=xxx }

----*xxx - wype?niij
----Przyk?ad
----bramy[1] = {x=-1631.8000488281, y=688.40002441406, z=8.6999998092651, z2=3, rot=270, id=10184, rozmiar=10, acl="Policja" }

data = {}
data.max = 1 --//Ilosc bram 

brama = {} --//Tabela bram
maker = {} --//Tabela marker?w

function createBrama () --Tworzenie bram
    for i=1, data.max do --P?tla do pobierania ilosci bram
    brama[i] = createObject ( 5422, -127.40, 1033.90, 20.79, 0, 0, 90) --//Tworzebie objektu(Brama)
    maker[i] = createMarker(-124.50101, 1035.11816, 19, 'cylinder', 1.5, 0, 255, 0, 75) --//Tworzebie Markeru
    outputDebugString( "Storzono brame o id "..i)
    end
end
addEventHandler( "onResourceStart", getRootElement(), createBrama)

function Wjedz(hitPlayer) --Wchodzenie do bramy 
    for i=0, data.max do --P?tla do pobierania ilosci bram
        if source == maker[i] then --Sprawdzanie czy marker jest markerem bramy
            if getElementType( hitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz = getPlayerName( hitPlayer ) -- Pobieranie Nazwy gracza
                local konto = getAccountName( getPlayerAccount( hitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup( 'user.'..konto, aclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje si? w acl
                    moveObject ( 5422, 10000, 127.40, 1033.90,  16.40)
                    outputChatBox( "● Otworzy?e? brame o id: "..i, hitPlayer, 0,255,255, true)
                    outputDebugString( "Otwieranie bramy o id "..i.." przez "..gracz.."" )
                end
            end
        end
        
    end    
end
addEventHandler ( "onMarkerHit", getRootElement(), Wjedz )

function Wyjedz(hitPlayer) -- Wychodzenie z bramy
    for i=0, data.max do --P?tla do pobierania ilosci bram
        if source == maker[i] then --Sprawdzanie czy marker jest markerem bramy
            if getElementType( hitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz = getPlayerName( hitPlayer ) -- Pobieranie Nazwy gracza
                local konto = getAccountName( getPlayerAccount( hitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup( 'user.'..konto, aclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje si? w acl
                    moveObject ( 5422, 10000,-127.40, 1033.90, 20.79, 0, 0, 90)
                    outputChatBox( "● Zamkn??e? brame o id: "..i, hitPlayer, 0,255,255, true)
                    outputDebugString( "Zamkni?cie bramy o id "..i.." przez "..gracz.."" )
                end
            end
        end    
    end
end
addEventHandler ( "onMarkerLeave", getRootElement(), Wyjedz )

Sprawd? to.

Podpis
GG:75080675
- ✔
- ✔
- ✔
- ✔

Aktualny projekt: BRAK
Postaw piwo autorowi tego posta
 

 
Tagi: bramy :: marker
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA 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