Mi problema es que quiero hacer que obtenga todos los jugadores conectados... coja a los que son admin, smod, mod y les de un setAccountData... para en el client-side obtenerlos con getAccountData y organizarlos en una lista, por color.
Server-side:
function getRanks()
for index, player in ipairs(getElementsByType("player")) do
local account = getPlayerAccount( player )
if account and not isGuestAccount( account ) then
local accountName = getAccountName( account );
if isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Admin" ) ) then
setAccountData(player, "RAdmin", "Si")
elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "SuperModerator" ) ) then
setAccountData(player, "RSmod", "Si")
elseif isObjectInACLGroup ( "user." .. accountName, aclGetGroup ( "Moderator" ) ) then
setAccountData(player, "RMod", "Si")
end
end
end
end
Client-Side:
function Actualizar()
guiGridListClear(LISTA)
for index, player in ipairs(getElementsByType("player")) do
FILA = guiGridListAddRow(LISTA)
guiGridListSetItemText ( LISTA, FILA, COLUMNA, (string.gsub ( getPlayerName(player), '#%x%x%x%x%x%x', '' ) or getPlayerName(player)), false, false)
guiGridListSetItemData ( LISTA, FILA, COLUMNA, getPlayerName(player))
if (getElementData(player, "RAdmin")) then
guiGridListSetItemColor(LISTA, FILA, COLUMNA, 0, 0, 255)
elseif (getElementData(player, "RSmod")) then
guiGridListSetItemColor(LISTA, FILA, COLUMNA, 0, 255, 255)
elseif (getElementData(player, "RMod")) then
guiGridListSetItemColor(LISTA, FILA, COLUMNA, 255, 255, 0)
else
guiGridListSetItemColor(LISTA, FILA, COLUMNA, 255, 255, 255)
end
end
end
Asi como esta marca que el argumento 1 de setAccountData del server-side esta mal. No he logrado hacer que obtenga tampoco.