ULX

Author Topic: Advert Variables  (Read 1395 times)

0 Members and 1 Guest are viewing this topic.

Offline alig96

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
Advert Variables
« on: February 07, 2013, 03:26:58 AM »
Hey there, recently got a 24/7 server on the go, and I don't plan on being on for the same amount of time, so I'm going have several mods or admins looking after it while I'm not on.

So basically I want to add an advert that says "Admins online: <list of online admins>" and the same for the mods. Is it possible to get the lists and comma delaminate them?

Offline Stickly Man!

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 1270
  • Karma: 164
  • What even IS software anymore?
    • XGUI
Re: Advert Variables
« Reply #1 on: February 07, 2013, 10:33:43 AM »
Unfortunately this is not possible at the moment. It does sound like a potentially useful feature (and fairly simple to implement), and I'll run it past Megiddo to see what he thinks.

Otherwise, you can accomplish something similar by making a very simple lua script like the following (not tested, doing this off the top of my head :P )
Code: [Select]
local function displayAdmins()
local admins = {}
for _, ply in ipairs(player.GetAll()) do
if ply:IsUserGroup("admin") then
table.insert{ admins, ply:Nick() }
end
end
ULib.tsayColor( _, true, Color( 255, 0, 0), "Admins online: " .. table.concat( admins, ", " ) )
timer.Simple( 100, displayAdmins )
end
timer.Simple( 100, displayAdmins )
Join our Team Ulysses community discord! https://discord.gg/gR4Uye6