General > Developers Corner

a "who" modification

(1/2) > >>

Sloth Armstronk:
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: ---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." )
--- End code ---

An Error Has Occurred!

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

[0] Board index

Go to full version