Author Topic: a "who" modification  (Read 2920 times)

0 Members and 1 Guest are viewing this topic.

Offline Sloth Armstronk

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
  • Space. Space is.. Scary as
a "who" modification
« on: November 04, 2015, 09:00:01 AM »
So I'm trying to make a modification on the who command, but the problem is that I don't know how to make it so it only prints staff ex. "1 Sloth         owner"

Here is the code:
Code: [Select]
function ulx.staff( calling_ply )

local players = player.GetAll()
for _, player in ipairs( players ) do
local id = tostring( player:UserID() )
local nick = player:Nick()
local text = string.format( "%i%s %s%s ", id, string.rep( " ", 2 - id:len() ), nick, string.rep( " ", 31 - nick:len() ) )

text = text .. player:GetUserGroup()

ULib.tsayError( calling_ply, text )
end
end
local staff = ulx.command( CATEGORY_NAME, "ulx staff", ulx.staff, "!staff" )
staff:defaultAccess( ULib.ACCESS_ALL )
staff:help( "See information about currently online staff members." )

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given