I am trying to make it so when people that do not have access to 'ulx seeasay' use @ it has a different format than people who do have access to it. For example:
Admins using asay: (Admins) Sweepyoface: Hello!
User using asay: (Admin Request) bob123: Help! RDM!
I know its in here but I don't know how to code it.
------------------------------ Asay ------------------------------
local seeasayAccess = "ulx seeasay"
if SERVER then ULib.ucl.registerAccess( seeasayAccess, ULib.ACCESS_OPERATOR, "Ability to see 'ulx asay'", "Other" ) end -- Give operators access to see asays echoes by default
function ulx.asay( calling_ply, message )
local format
local me = "/me "
if message:sub( 1, me:len() ) == me then
format = "(ADMINS) *** #P #s"
message = message:sub( me:len() + 1 )
else
format = "#P to admins: #s"
end
local players = player.GetAll()
for i=#players, 1, -1 do
local v = players[ i ]
if not ULib.ucl.query( v, seeasayAccess ) and v ~= calling_ply then -- Calling player always gets to see the echo
table.remove( players, i )
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." )
Edit: I made a little something, I'm pretty sure this won't work. Can anyone help?
function ulx.asay( calling_ply, message )
local format
if calling_ply(seeasayAccess) ~= true then
format = "(Admin Request) #P: #s"
else
format = "(Admins) #P: #s"
end