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

Wysłany: 2013-07-18, 15:47


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Witajcie.


Jak zrobi? co? takiego ?e po wpisaniu /admins b?dzie pokazywa?o administrator?w i moderator?w online kt?rzy s? wpisani w grup? ACL. ?

Pozdrawiam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-18, 19:21


irvs126

www.lss-rp.pl






Wiek: 36
Na forum: 5461 dni
Posty: 109
Nick w MP: irvs126

Piwa: 97

Respekt: 63,3

Wszystkich wpisanych w grup? ACL, czy tylko tych kt?rzy s? obecni na serwerze?

Podpis
, Sprawdź pierwszy serwer Roleplay, stawiający duży nacisk na grę In Character!
www.lss-rp.pl
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-18, 20:37


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Tych co s? online na serwerze.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-18, 21:40


luki123luki123

Place Game






Wiek: 28
Na forum: 5275 dni
Posty: 1948
Nick w MP: LuKiO

Piwa: 6101

Respekt: 611
Respekt: 611Respekt: 611


function admins()
players getElementsByType "player" )
admins ""
for k,v in ipairs(players) do
   local accountname ""
   if (isGuestAccount(getPlayerAccount(v)) == falsethen
      accountname getAccountName (getPlayerAccount(v))
      if isObjectInACLGroup "user." .. accountnameaclGetGroup "admin" ) ) then
         if (admins == ""then
            admins getPlayerName(v)
         else
            admins admins .. ", " .. getPlayerName(v)
            outputChatBox"Online Admins: "getRootElement(), 2552550)
outputChatBox" " .. tostring admins ), getRootElement(), 2552550)
         end
      end
   end
end
end
addCommandHandler "admins"admins )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-18, 22:55


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
"luki123luki123" napisał/a:


function admins()
players getElementsByType "player" )
admins ""
for k,v in ipairs(players) do
   local accountname ""
   if (isGuestAccount(getPlayerAccount(v)) == falsethen
      accountname getAccountName (getPlayerAccount(v))
      if isObjectInACLGroup "user." .. accountnameaclGetGroup "admin" ) ) then
         if (admins == ""then
            admins getPlayerName(v)
         else
            admins admins .. ", " .. getPlayerName(v)
            outputChatBox"Online Admins: "getRootElement(), 2552550)
outputChatBox" " .. tostring admins ), getRootElement(), 2552550)
         end
      end
   end
end
end
addCommandHandler "admins"admins )


Ten skrypt nie dzia?a poprawnie, on z neta jest :/

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-19, 01:18


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

2 sekundy na wiki:

function getOnlineAdmins()
    local t = {}
    for k,v in ipairs getElementsByType("player") ) do
        while true do
            local acc getPlayerAccount(v)
            if not acc or isGuestAccount(accthen break end
            local accName getAccountName(acc)
            local isAdmin isObjectInACLGroup("user."..accName,aclGetGroup("Admin"))
            if isAdmin == true then
                table.insert(t,v)
            end
            break
        end
    end
    return t
end


Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-19, 01:27


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
A jak zrobi? ?eby np. Jak jest administrator dost?pny to ?eby wy?wietla?o :

Kod:


Zarzad:

-lista adminow-

Admin:

-lista nizszej rangi-

Moderator:

-lista moderatorow-


?

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-19, 02:05


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Wszystko zale?y od Ciebie. Gdzie chcesz by to si? znalaz?o? W?tpi? by na czacie.

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-19, 09:51


xHardus







Wiek: 27
Na forum: 4786 dni
Posty: 90
Nick w MP: Harduś

Piwa: 786

Respekt: 15,3

Kod:

function getOnlineAdmins()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isAdmin = isObjectInACLGroup("user."..accName,aclGetGroup("Admin"))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end

function getOnlineModerator()
local t = {}
for k,v in ipairs ( getElementsByType("player") ) do
while true do
local acc = getPlayerAccount(v)
if not acc or isGuestAccount(acc) then break end
local accName = getAccountName(acc)
local isModerator = isObjectInACLGroup("user."..accName,aclGetGroup("Moderator"))
if isModerator == true then
table.insert(t,v)
end
break
end
end
return t
end


O to chodzi?o?

Postaw piwo autorowi tego posta
 

 
Więcej szczegółów
Wystawiono 2 piw(a):
Mezo., psychol.
Wysłany: 2013-07-19, 10:06


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
Tak o to, piwko leci dla Ciebie. Tylko ?eby jeszcze napis wy?wietla? ?e np.

Kod:


Zarzad online:
- nick jak jest dostepny

Admin online:
- nick jak jest dostepny

Moderator online:
- nick jak jest dostepny


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-20, 11:01


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Musisz pobawi? si? mo?liwe ?e w ACL. Pod 3 grupy (Zarzad, Admin, Moderatorzy) i wklepujesz ludzi online do 3 oddzielnych tablic (dla ka?dej grupy).

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-07-22, 14:45


wwa22442







Wiek: 38
Na forum: 4706 dni
Posty: 127

Piwa: 82

Respekt: 50

Ostrzeżeń: 20%
A to ma by? po stronie klienta czy serwera ?

[ Dodano: 2013-07-22, 14:54 ]
Jak do tego kodu doda?, ?e jak kto? np. jest w grupie ACL. w "admins" to zeby kolo jego nicku widnia? napis " - Zarzad" ?


addCommandHandler("admins",function(p)
    local Admins,SuperModerators,Moderator getOnlineAdmins() -- the function will return 3 tables
    if #Admins ~= 0 then -- if the admins table not empty then
        outputChatBox("Administracja Online:",p,255,0,0,true)
        for k,v in ipairs Admins ) do -- loop the table
            outputChatBox(""..getPlayerName(v),p,255,128,0,true) -- output the player name
        end
    end
end 
)

function getOnlineAdmins()
    local t1,t2,t3 = {},{},{}
    for k,v in ipairs getElementsByType("player") ) do
        local acc getPlayerAccount(v);if not acc or isGuestAccount(accthen return end;local accName getAccountName(acc)
        local isAdmin,isSMOD,isMod isObjectInACLGroup("user."..accName,aclGetGroup("Admin")),isObjectInACLGroup("user."..accName,aclGetGroup("SuperModerator")),isObjectInACLGroup("user."..accName,aclGetGroup("Moderator"))
        if isAdmin == true then
            table.insert(t1,v)
        elseif isSMOD == true then
            table.insert(t2,v)
        elseif isMod == true then
            table.insert(t3,v)
        end
        return t1,t2,t3
    end
end


Postaw piwo autorowi tego posta
 

 
Tagi: admini :: mody :: online
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