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 " .. message:sub( me:len() + 1 )
else
format = "#P to admins: " .. message
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 )
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." )
This is the code i have in ULX. The lua file is chat. This code is used for the admin chat "@" .
When a non admin player in game uses the @ <message> command it says <player> to admins: <message>
But, when an admin does the @ <massage> command it does the same thing... even though in the code it says that an admin -admin convo should be (ADMINS) <player>: <Messsage>
I just wanted to know, is there something wrong with my code?
If you have the code please help me. Thanks