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

-----------------------------------------------------------------------------------------------------------------------------------
-- @nameSystem Bram
-- @authorLuKiO
-- @date11-08-2015
-- @version1.0.0
-- @infoZakaz zmiany autora skryptu
-- @For: Gtao.pl
---------------------------------------------------------
bramy = {}
bramy[1] = {x=xxxy=xxxz=xxxz2=xxxrot=xxxid=xxxrozmiar=xxxacl=xxx }

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

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

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

function createBrama () --Tworzenie bram
    for i=1data.max do --P?tla do pobierania ilosci bram
    brama[i] = createObject 5422, -127.401033.9020.790090) --//Tworzebie objektu(Brama)
    maker[i] = createMarker(-124.501011035.1181619'cylinder'1.50255075) --//Tworzebie Markeru
    outputDebugString"Storzono brame o id "..i)
    end
end
addEventHandler"onResourceStart"getRootElement(), createBrama)

function Wjedz(hitPlayer) --Wchodzenie do bramy 
    for i=0data.max do --P?tla do pobierania ilosci bram
        if source == maker[ithen --Sprawdzanie czy marker jest markerem bramy
            if getElementTypehitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz getPlayerNamehitPlayer ) -- Pobieranie Nazwy gracza
                local konto getAccountNamegetPlayerAccounthitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup'user.'..kontoaclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje siw acl
                    moveObject 542210000127.401033.90,  16.40)
                    outputChatBox"● Otworzy?e? brame o id: "..ihitPlayer0,255,255true)
                    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=0data.max do --P?tla do pobierania ilosci bram
        if source == maker[ithen --Sprawdzanie czy marker jest markerem bramy
            if getElementTypehitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz getPlayerNamehitPlayer ) -- Pobieranie Nazwy gracza
                local konto getAccountNamegetPlayerAccounthitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup'user.'..kontoaclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje siw acl
                    moveObject 542210000,-127.401033.9020.790090)
                    outputChatBox"● Zamkn??e? brame o id: "..ihitPlayer0,255,255true)
                    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: 22
Na forum: 3865 dni
Posty: 498
Nick w MP: nanky

Piwa: 1773

Respekt: 239
Respekt: 239Respekt: 239

Zmie?

 if isObjectInACLGroup'user.'..kontoaclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje siw acl

na

                if isObjectInACLGroup'user.'..kontoaclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje siw acl


Postaw piwo autorowi tego posta
 

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


adisonboss







Wiek: 23
Na forum: 3331 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: 3681 dni
Posty: 146
Nick w MP: Malentas

Piwa: 1626

Respekt: 47,3

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


local bramy = {
    --{kordy bramyrot bramykordy markeruaclgrup}
    {-127.401033.9020.7990, -124.501011035.1181619"OSP"},
}

local maks 0

for iv in ipairs(bramy) do
    brama createObject(5422v[1], v[2], v[3], 00v[4])
    marker createMarker(v[5], v[6], v[7], "cylinder"1.525500255)
    setElementData(marker"frakcja"v[8])
    setElementData(marker"kordy"v[1]..","..v[2]..","..v[3])
    addEventHandler("onMarkerHit"markermarkerHit)
    addEventHandler "onMarkerLeave"markermarkerLeave)
    maks maks+1
end

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

function markerLeave(hitPlayer)
     if getElementType(player) == "player" then
        local gracz getPlayerName(player)
        local konto getAccountName(getPlayerAccount(player))
        if isObjectInACLGroup'user.'..kontoaclGetGroup(getElementData(source"frakcja"))) then
            local kordy split(getElementData(source"kordy"), ",")
            moveObject(542210000kordy[1], kordy[2], kordy[3]+4)
            outputChatBox("Zamkn??e? brame"player0255255)
        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: 3331 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: 26
Na forum: 3061 dni
Posty: 1060
Nick w MP: PatryKK.

Piwa: 2322

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


-----------------------------------------------------------------------------------------------------------------------------------
-- @nameSystem Bram
-- @authorLuKiO
-- @date11-08-2015
-- @version1.0.0
-- @infoZakaz zmiany autora skryptu
-- @For: Gtao.pl
---------------------------------------------------------
bramy = {}
bramy[1] = {x=xxxy=xxxz=xxxz2=xxxrot=xxxid=xxxrozmiar=xxxacl=xxx }

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

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

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

function createBrama () --Tworzenie bram
    for i=1data.max do --P?tla do pobierania ilosci bram
    brama[i] = createObject 5422, -127.401033.9020.790090) --//Tworzebie objektu(Brama)
    maker[i] = createMarker(-124.501011035.1181619'cylinder'1.50255075) --//Tworzebie Markeru
    outputDebugString"Storzono brame o id "..i)
    end
end
addEventHandler"onResourceStart"getRootElement(), createBrama)

function Wjedz(hitPlayer) --Wchodzenie do bramy 
    for i=0data.max do --P?tla do pobierania ilosci bram
        if source == maker[ithen --Sprawdzanie czy marker jest markerem bramy
            if getElementTypehitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz getPlayerNamehitPlayer ) -- Pobieranie Nazwy gracza
                local konto getAccountNamegetPlayerAccounthitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup'user.'..kontoaclGetGroup("OSP") ) then --Sprawdzenie czy gracz znajduje siw acl
                    moveObject 542210000127.401033.90,  16.40)
                    outputChatBox"● Otworzy?e? brame o id: "..ihitPlayer0,255,255true)
                    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=0data.max do --P?tla do pobierania ilosci bram
        if source == maker[ithen --Sprawdzanie czy marker jest markerem bramy
            if getElementTypehitPlayer ) == "player" then --Sprawdzanie czy element w markerze to gracz
                local gracz getPlayerNamehitPlayer ) -- Pobieranie Nazwy gracza
                local konto getAccountNamegetPlayerAccounthitPlayer ) ) --Pobieranie Loginu gracz
                if isObjectInACLGroup'user.'..kontoaclGetGroup(bramy[i].acl) ) then --Sprawdzenie czy gracz znajduje siw acl
                    moveObject 542210000,-127.401033.9020.790090)
                    outputChatBox"● Zamkn??e? brame o id: "..ihitPlayer0,255,255true)
                    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 » Bramy na marker 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