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

Wysłany: 2015-04-18, 16:42


ProWhiteQ

Ucze sie LUA






Wiek: 45
Na forum: 4341 dni
Posty: 38

Piwa: 6

Respekt: 50

Witam Mam taki oto problem z klatka gdy? na serwerze takim co jest po zainstalowaniu "MTA SA" dzia?a natomiast na serwerze hostingowanym nie dzia?a daje kod moze da sie to jakos rozwiazac:


-- Copyright by Fanta @2014. Zachowaj autora !

local kratki={}
klatka = {}
local komenda "klatka" -- komenda bez '/'

addCommandHandler(komenda, function(plrcmdtarget)
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
    if not target then 
        outputChatBox("Uzyj: /klatka <nick gracza>")
        return
    end

    local cel=getPlayerFromName(target)
    if not cel then 
        outputChatBox("Nie ma takiego gracza.")
        return
    end

    local x,y,z=getElementPosition(cel)
    local dim=getElementDimension(cel)
    local int=getElementInterior(cel)

    if kratki[celthen
        for i=1#kratki[cel] do -- najoptymalniejsza petla
            if isElement(kratki[cel][i]) then
                destroyElement(kratki[cel][i])
            end
        end
        kratki[cel]=nil
    end

    kratki[cel]={}
    kratki[cel][1]=createObject(971xyz-0.92700180.0) -- O.KNie rusza?
    kratki[cel][2]=createObject(971xyz+62700180) -- O.K Nie rusza?
    kratki[cel][3]=createObject(971xy+3.5z+2.5000) -- O.KNie rusza?
    kratki[cel][4]=createObject(971x-4.5yz+2.500270) -- O.KNie rusza?
    kratki[cel][5]=createObject(971xy-3.5z+2.500180) -- O.KNie rusza?
    kratki[cel][6]=createObject(971x+4yz+2.500270) -- O.KNie rusza?
    table.insert klatkakratki[cel][1] )
    table.insert klatkakratki[cel][2] )
    table.insert klatkakratki[cel][3] )
    table.insert klatkakratki[cel][4] )
    table.insert klatkakratki[cel][5] )
    table.insert klatkakratki[cel][6] )
    

    setElementInterior(kratki[cel][1], int)
    setElementDimension(kratki[cel][1], dim)
    setElementInterior(kratki[cel][2], int)
    setElementDimension(kratki[cel][2], dim)
    setElementInterior(kratki[cel][3], int)
    setElementDimension(kratki[cel][3], dim)
    setElementInterior(kratki[cel][4], int)
    setElementDimension(kratki[cel][4], dim)
    setElementInterior(kratki[cel][5], int)
    setElementDimension(kratki[cel][5], dim)
    setElementInterior(kratki[cel][6], int)
    setElementDimension(kratki[cel][6], dim)
    outputChatBox("Stworzy?e?/a? klatk? wok?? gracza " .. getPlayerName(cel), plr)
    end
end)


-- Event

function zabezpieczenie()
        -- zabezpieczenie jezeli zakratowano graczaa on wyszedl.
    if kratki[sourcethen
        for i=1#kratki[source] do
            if isElement(kratki[source][i]) then
                destroyElement(kratki[source][i])
            end
        end
        kratki[source]=nil
    end
end
addEventHandler("onPlayerQuit"rootzabezpieczenie)
addCommandHandler("klatkausun"zabezpieczenie)


addCommandHandler "usunklatke", function(plr)
for k,v in ipairs klatka ) do
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
destroyElement )
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-22, 22:20


Zbyklon







Wiek: 50
Na forum: 4290 dni
Posty: 45
Nick w MP: Zbyklon

Piwa: 7

Respekt: 55,3

Wyst?puje jaki? b??d ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-23, 21:31


THEGizmo

Modeler/Uczeń Lua






Wiek: 27
Na forum: 4141 dni
Posty: 255
Nick w MP: THEGizmo

Piwa: 3072

Respekt: 200
Respekt: 200Respekt: 200

Czasami b??dem jest to ze s? polskie znaki czyli ( ?, ? itp ) i dla tego skrypt nie dzia?a

-- Copyright by Fanta @2014. Zachowaj autora !

local kratki={}
klatka = {}
local komenda "klatka" -- komenda bez '/'

addCommandHandler(komenda, function(plrcmdtarget)
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
    if not target then 
        outputChatBox("Uzyj: /klatka <nick gracza>")
        return
    end

    local cel=getPlayerFromName(target)
    if not cel then 
        outputChatBox("Nie ma takiego gracza.")
        return
    end

    local x,y,z=getElementPosition(cel)
    local dim=getElementDimension(cel)
    local int=getElementInterior(cel)

    if kratki[celthen
        for i=1#kratki[cel] do -- najoptymalniejsza petla
            if isElement(kratki[cel][i]) then
                destroyElement(kratki[cel][i])
            end
        end
        kratki[cel]=nil
    end

    kratki[cel]={}
    kratki[cel][1]=createObject(971xyz-0.92700180.0)
    kratki[cel][2]=createObject(971xyz+62700180)
    kratki[cel][3]=createObject(971xy+3.5z+2.5000)
    kratki[cel][4]=createObject(971x-4.5yz+2.500270)
    kratki[cel][5]=createObject(971xy-3.5z+2.500180)
    kratki[cel][6]=createObject(971x+4yz+2.500270)
    table.insert klatkakratki[cel][1] )
    table.insert klatkakratki[cel][2] )
    table.insert klatkakratki[cel][3] )
    table.insert klatkakratki[cel][4] )
    table.insert klatkakratki[cel][5] )
    table.insert klatkakratki[cel][6] )
    

    setElementInterior(kratki[cel][1], int)
    setElementDimension(kratki[cel][1], dim)
    setElementInterior(kratki[cel][2], int)
    setElementDimension(kratki[cel][2], dim)
    setElementInterior(kratki[cel][3], int)
    setElementDimension(kratki[cel][3], dim)
    setElementInterior(kratki[cel][4], int)
    setElementDimension(kratki[cel][4], dim)
    setElementInterior(kratki[cel][5], int)
    setElementDimension(kratki[cel][5], dim)
    setElementInterior(kratki[cel][6], int)
    setElementDimension(kratki[cel][6], dim)
    outputChatBox("Stworzyles/as klatke wokol gracza " .. getPlayerName(cel), plr)
    end
end)


-- Event

function zabezpieczenie()
        -- zabezpieczenie jezeli zakratowano graczaa on wyszedl.
    if kratki[sourcethen
        for i=1#kratki[source] do
            if isElement(kratki[source][i]) then
                destroyElement(kratki[source][i])
            end
        end
        kratki[source]=nil
    end
end
addEventHandler("onPlayerQuit"rootzabezpieczenie)
addCommandHandler("klatkausun"zabezpieczenie)


addCommandHandler "usunklatke", function(plr)
for k,v in ipairs klatka ) do
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then 
destroyElement )
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-24, 12:37


ProWhiteQ

Ucze sie LUA






Wiek: 45
Na forum: 4341 dni
Posty: 38

Piwa: 6

Respekt: 50

Te? nic W konsoli znalazlem takie cos:

[2015-04-24 12:29] SCRIPT ERROR: klatka/klatka_s.lua:27: '<name>' expected near '1'
[2015-04-24 12:29] ERROR: Loading script failed: klatka/klatka_s.lua:27: '<name>' expected near '1'
[2015-04-24 12:29] startResource: Resource 'klatka' started
[2015-04-24 12:29] ADMIN: Resource 'klatka' started by ProWhiteQ

Czy to s? jakie? b?edy ?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-24, 13:53


MeeShuffle

Programista/Grafik






Wiek: 32
Na forum: 4394 dni
Posty: 2758
Nick w MP: Shuffle

Piwa: 8575

Respekt: 535,3
Respekt: 535,3

  if isElement(kratki[cel][i]) then



Co to jest?

Podpis

https://shufflecode.pl
Static Codes and Graphics - Join our discord!
Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-24, 15:43


THEGizmo

Modeler/Uczeń Lua






Wiek: 27
Na forum: 4141 dni
Posty: 255
Nick w MP: THEGizmo

Piwa: 3072

Respekt: 200
Respekt: 200Respekt: 200

Spr?buj tera ;)

-- Copyright by Fanta @2014. Zachowaj autora ! --

local kratki={}
klatka = {}
local komenda "klatka" -- komenda bez '/' --

addCommandHandler(komenda, function(plrcmdtarget)
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
    if not target then 
        outputChatBox("Uzyj: /klatka <nick gracza>")
        return
    end

    local cel=getPlayerFromName(target)
    if not cel then 
        outputChatBox("Nie ma takiego gracza !")
        return
    end

    local x,y,z=getElementPosition(cel)
    local dim=getElementDimension(cel)
    local int=getElementInterior(cel)

    if kratki[celthen
        for i=1#kratki[cel] do -- najoptymalniejsza petla
            if isElement(kratki[cel][i]) then
                destroyElement(kratki[cel][i])
            end
        end
        kratki[cel]=nil
    end

    kratki[cel]={}
    kratki[cel][1]=createObject(971xyz-0.92700180.0)
    kratki[cel][2]=createObject(971xyz+62700180)
    kratki[cel][3]=createObject(971xy+3.5z+2.5000)
    kratki[cel][4]=createObject(971x-4.5yz+2.500270) 
    kratki[cel][5]=createObject(971xy-3.5z+2.500180)
    kratki[cel][6]=createObject(971x+4yz+2.500270)
    table.insert klatkakratki[cel][1] )
    table.insert klatkakratki[cel][2] )
    table.insert klatkakratki[cel][3] )
    table.insert klatkakratki[cel][4] )
    table.insert klatkakratki[cel][5] )
    table.insert klatkakratki[cel][6] )
    

    setElementInterior(kratki[cel][1], int)
    setElementDimension(kratki[cel][1], dim)
    setElementInterior(kratki[cel][2], int)
    setElementDimension(kratki[cel][2], dim)
    setElementInterior(kratki[cel][3], int)
    setElementDimension(kratki[cel][3], dim)
    setElementInterior(kratki[cel][4], int)
    setElementDimension(kratki[cel][4], dim)
    setElementInterior(kratki[cel][5], int)
    setElementDimension(kratki[cel][5], dim)
    setElementInterior(kratki[cel][6], int)
    setElementDimension(kratki[cel][6], dim)
    outputChatBox("Stworzyles/as klatke wokol gracza " .. getPlayerName(cel), plr)
    end
end)


--Event--

function zabezpieczenie()
        -- zabezpieczenie jezeli zakratowano graczaa on wyszedl. --
    if kratki[sourcethen
        for i=1#kratki[source] do
            if isElement(kratki[source][i]) then
                destroyElement(kratki[source][i])
            end
        end
        kratki[source]=nil
    end
end
addEventHandler("onPlayerQuit"rootzabezpieczenie)
addCommandHandler("klatkausun"zabezpieczenie)


addCommandHandler "usunklatke", function(plr)
for k,v in ipairs klatka ) do
local accName getAccountName getPlayerAccount plr ) ) 
     if isObjectInACLGroup ("user."..accNameaclGetGroup "Admin" ) ) then
destroyElement vplr )
end
end
end)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2015-04-24, 16:00


ProWhiteQ

Ucze sie LUA






Wiek: 45
Na forum: 4341 dni
Posty: 38

Piwa: 6

Respekt: 50

"Shuffle" napisał/a:

  if isElement(kratki[cel][i]) then



Co to jest?


Nie Wiem co to jest pobra?em to z tej strony.

Postaw piwo autorowi tego posta
 

 
Tagi: klatka :: nie :: działa
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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