Ulysses Stuff > Suggestions

Admin Chat

(1/2) > >>

sabo:
Hello.

I have a TTT server on which I have alot of staff members.

Sometimes it is hard to overlook who is what rank or if the person is a staff rank...

Here is my suggestion:

If a staff member (can be stated in a config file maybe) writes in admin chat it will be something like this:

Admin sabo: Hello!

If a non Staff member types to admins:

To Admins sabo: Hello!

What do you guys think about this?

I am simply suggesting to make it visually differentiated if the person typing in admin chat is staff or not.

Megiddo:
Our method of logging does not currently allow arbitrary color change like this, but it would be a relatively straight forward modification to add some text indicating the user's position. Do you really have the admin chat used that frequently?

aaron:

--- Quote from: Megiddo on September 13, 2013, 03:14:38 PM ---Our method of logging does not currently allow arbitrary color change like this, but it would be a relatively straight forward modification to add some text indicating the user's position. Do you really have the admin chat used that frequently?

--- End quote ---

I'm staff on the server and the admin chat is a pretty big thing in there among all the staff. We use it quite a lot.

It would be nice to have something to distinguish between a user and a staff member, although it isnt that big of a deal in my opinion.

MrPresident:
Try this..

Replace inside of ULX/lua/ulx/modules/sh/chat.lua
(Make a backup first!)

--- Code: ---function ulx.asay( calling_ply, message )

local players = player.GetAll()
for i=#players, 1, -1 do
local v = players[ i ]
if ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then
if ULib.ucl.query( calling_ply, seeasayAccess ) then
ULib.tsayColor(v, 1, Color(255,0,0), "::Admin:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(255,255,255), ": ", message )
else
ULib.tsayColor(v, 1, Color(255,255,0), "::Non Admin:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(255,255,255), ": ", message )
end
end
if v == calling_ply then
ULib.tsayColor(v, 1, Color(0,255,0), "::To Admins:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(255,255,255), ": ", message )
end
end

local logFile = ulx.convar( "logFile", "1", "Log to file (Can still echo if off). This is a global setting, nothing will be logged to file with this off.", ULib.ACCESS_SUPERADMIN )
if logFile:GetBool() then
ulx.logString( calling_ply:Nick() .. " to admins: " .. message, true )
end
end
local asay = ulx.command( CATEGORY_NAME, "ulx asay", ulx.asay, "@", true, true )
asay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
asay:defaultAccess( ULib.ACCESS_ALL )
asay:help( "Send a message to currently connected admins." )

--- End code ---


It should look like this:
An admin for the purposes of this script is anyone with 'ulx seeasay' access. (Anyone who can read admin chat)
It also uses the color of your team name like regular chat does.

You say something: ::To Admins:: MrPresident: Hello there! I'm just testing this.

Admin says something: ::Admin:: MrPresident: Hello there! I'm just testing this.

Non-Admin says something: ::Non Admin:: MrPresident: Hello there! I'm just testing this.

sabo:
Thanks alot Mr President!!

So here is what I used:


--- Code: ---function ulx.asay( calling_ply, message )

local players = player.GetAll()
for i=#players, 1, -1 do
local v = players[ i ]
if ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then
if ULib.ucl.query( calling_ply, seeasayAccess ) then
ULib.tsayColor(v, 1, Color(65,105,225), "::Admin:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(112,138,144), ": ", message )
else
ULib.tsayColor(v, 1, Color(0,0,0), "::User:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(119,136,153), ": ", message )
end
end
if v == calling_ply then
ULib.tsayColor(v, 1, Color(49,79,79), "::To Admins:: ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(112,138,144), ": ", message )
end
end

ulx.fancyLog( players, format, calling_ply, message )
end
local asay = ulx.command( CATEGORY_NAME, "ulx asay", ulx.asay, "@", true, true )
asay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
asay:defaultAccess( ULib.ACCESS_ALL )
asay:help( "Send a message to currently connected admins." )

--- End code ---


I am confused about this part from you:


--- Code: ---local logFile = ulx.convar( "logFile", "1", "Log to file (Can still echo if off). This is a global setting, nothing will be logged to file with this off.", ULib.ACCESS_SUPERADMIN )
if logFile:GetBool() then
ulx.logString( calling_ply:Nick() .. " to admins: " .. message, true )
end
end
local asay = ulx.command( CATEGORY_NAME, "ulx asay", ulx.asay, "@", true, true )
asay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
asay:defaultAccess( ULib.ACCESS_ALL )
asay:help( "Send a message to currently connected admins." )

--- End code ---

Not sure if I should replace it with my current one :O

Do you mind explaining why you have that? :I

Thanks again!

Navigation

[0] Message Index

[#] Next page

Go to full version