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

Wysłany: 2016-02-23, 22:18


Micles258

Uczeń lua






Wiek: 25
Na forum: 4149 dni
Posty: 48

Piwa: 437

Respekt: 60

Ostrzeżeń: 100%
Wykorzysta?em kod od http://gtao.pl/on-line-vt101287.htm#642570.
SS'y :

(doda?em tam tylko moderatora]
Admin = aclGetGroup ( "Admin" )
Rcon = aclGetGroup ( "RCON" )
Moderator = aclGetGroup ( "Moderator" )

function jestRCONem(gracz)
        if not getPlayerAccount(gracz) then return false end
accName = getAccountName(getPlayerAccount(gracz))
        if not accName then return false end
if isObjectInACLGroup ("user."..accName, Rcon ) then return true end
end


function jestADMINem(gracz)
if not getPlayerAccount(gracz) then return false end
accName = getAccountName(getPlayerAccount(gracz))
if not accName then return false end
if isObjectInACLGroup ("user."..accName, Admin ) then return true end
end


function jestModem(gracz)
if not getPlayerAccount(gracz) then return false end
accName = getAccountName(getPlayerAccount(gracz))
if not accName then return false end
if isObjectInACLGroup ("user."..accName, Moderator ) then return true end
end

addCommandHandler("admins", function(gracz,cmd)
    admini = {}
    rconi = {}
    moderatorzy = {}
            for k,v in ipairs(getElementsByType("player")) do
                if jestRCONem(v) then
                    table.insert(rconi, getPlayerName(v))
                    elseif jestModem (v) then
                    table.insert(moderatorzy, getPlayerName(v))
                    elseif jestADMINem(v) then
                    table.insert(admini, getPlayerName(v))
                end
             end
    for i=0,10 do
    outputChatBox(" ", gracz)
    end
    outputChatBox("Dost?pni RCON'i:", gracz)
        if #rconi > 0 then
            outputChatBox(table.concat(rconi, ", "), gracz)
        else
            outputChatBox("Brak", gracz)
        end
    outputChatBox(" ", gracz)
    outputChatBox("Dost?pni Admini:", gracz)
        if #admini > 0 then
            outputChatBox(table.concat(admini, ", "), gracz)
        else
            outputChatBox("Brak", gracz)
        end
    outputChatBox(" ", gracz)
    outputChatBox("Dost?pni Moderatorzy:", gracz)
        if #admini > 0 then
            outputChatBox(table.concat(moderatorzy, ", "), gracz)
        else
            outputChatBox("Brak", gracz)
        end
    
end
)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-23, 22:20


Patrix100

Amator LUA.






Wiek: 26
Na forum: 4028 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 953

Respekt: 40,5

No dobra a w czym problem? :p

Podpis
Pomogłem? Wystarczy że podziękujesz albo dasz respekt :D
Wole respekt niz piwka :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-23, 22:23


Micles258

Uczeń lua






Wiek: 25
Na forum: 4149 dni
Posty: 48

Piwa: 437

Respekt: 60

Ostrzeżeń: 100%
Problem polega na tym, ?e tam gdzie nie ma ?adnej osoby online to powinno pisa? "BRAK". Nie pisze mi tylko tego w moderatorach online. Ps. Masz ss'a u g?ry.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-23, 22:26


_Wicek_

Majstersztyk






Wiek: 26
Na forum: 4401 dni
Posty: 747
Nick w MP: Wicek

Piwa: 1842

Respekt: 360,5
Respekt: 360,5Respekt: 360,5Respekt: 360,5Respekt: 360,5

Ostrzeżeń: 40%
if #moderatorzy > 0 then


Podpis

Support-Team: 25.01.2016
Moderator: 10.07.2016




GG: 51274621
Skype : kuba_wicinski
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-23, 22:28


Patrix100

Amator LUA.






Wiek: 26
Na forum: 4028 dni
Posty: 182
Nick w MP: .:Patrix:.

Piwa: 953

Respekt: 40,5

Dodaj zamiast admini moderatorzy

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-02-23, 22:30


Micles258

Uczeń lua






Wiek: 25
Na forum: 4149 dni
Posty: 48

Piwa: 437

Respekt: 60

Ostrzeżeń: 100%
Ju? wiem co by?o nie tak, zamiast if #admini to powinno by? moderatorzy. Ale dzi?ki za ch?ci, do zamkni?cia.

Postaw piwo autorowi tego posta
 

 
Tagi: /admins :: ponownie
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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