Witam,kolega Rick napisa? mi skrypt lecz nie dzia?a mi on prosz? o pomoc.
ACL = {}
ACL[1] = "Rconi"
ACL[2] = "Administratorzy"
ACL[3] = "Moderatorzy"
function getOnlineModerators()
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(ACL[3]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end
function getOnlineRCONS()
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(ACL[1]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end
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(ACL[2]))
if isAdmin == true then
table.insert(t,v)
end
break
end
end
return t
end
addCommandHandler("admins",function(p)
local RCON = getOnlineRCONS()
local Admini = getOnlineAdmins()
local Moderators = getOnlineModerators()
if #RCON ~= 0 then
outputChatBox("RCONI:",p,150,0,0,true)
for k,v in ipairs ( RCON ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,150,0,0,true)
end
end
if #Admini ~= 0 then
outputChatBox("Administracja:",p,255,0,0,true)
for k,v in ipairs ( Admini ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,255,0,0,true)
end
end
if #Moderators ~= 0 then
outputChatBox("Moderatorzy:",p,0,0,150,true)
for k,v in ipairs ( Moderators ) do -- loop the table
outputChatBox("- "..getPlayerName(v),p,255,0,0,true)
end
end
Michael1236, ale teraz u?y?e? tego kodu, kt?ry ja poprawi?em, czy tego wcze?niejszego. Bo my?l?, ?e jednak by? b??d w kodzie, poniewa? addCommandHandler nie zosta? zamkni?ty "endem"
[ Dodano: 2014-08-16, 17:59 ]
Oczywi?cie je?li w mecie nie mia?e? [.lua] to by? b??d.....
PanMaszyna, Prosi?bym o kontakt ze mn? na GG : 43819478 lub FaceBook : http://facebook.com/ddubielak
Prosz? o szybki kontakt, chodzi o zlecenie skryptu
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