ULX

Author Topic: Shortcut of Asay overwrites /Advert  (Read 1680 times)

0 Members and 2 Guests are viewing this topic.

Offline Jason1337

  • Newbie
  • *
  • Posts: 7
  • Karma: 0
Shortcut of Asay overwrites /Advert
« on: April 28, 2014, 07:24:14 PM »
So the shortcut of asay = /a . However , when I want to advert something, it shows as "dvert" in asay. I don't know how to change the bind of asay so it doesn't override advert.
Code: [Select]
------------------------------ 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 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." )

------------------------------ Tsay ------------------------------
function ulx.tsay( 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), "AdminAdvert ", team.GetColor(calling_ply:Team()), calling_ply:Nick(), Color(255,255,255), ": ", message )
else
ULib.tsayColor(v, 1, Color(255,255,0), "AdminAdvert ", 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), "AdminAdvert ", 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 tsay = ulx.command( CATEGORY_NAME, "ulx tsay", ulx.tsay, "@@", true, true )
tsay:addParam{ type=ULib.cmds.StringArg, hint="message", ULib.cmds.takeRestOfLine }
tsay:defaultAccess( ULib.ACCESS_ADMIN )
tsay:help( "Send a message to everyone in the chat box." )
Yes I know the codes aren't fully setup, I just ran into this glitch and would like to know a fix :P

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Shortcut of Asay overwrites /Advert
« Reply #1 on: April 28, 2014, 08:50:30 PM »
So the shortcut of asay = /a

No, the shortcut of asay is @ in chat. @hello admins would print to the admins.
95% sure we don't use "/a" for any of our commands.

Sounds like you have a conflicting addon cutting off text, or code you've modified incorrectly.

Ulx chat related commands help.
] ULX Help:
ULX Help:
Category: Chat
   o ulx asay {message} - Send a message to currently connected admins. (say: @)
   o ulx csay {message} - Send a message to everyone in the middle of their screen. (say: @@@)
   o ulx gag <players> - Gag target(s), disables microphone. (say: !gag) (opposite: ulx ungag)
   o ulx gimp <players> - Gimps target(s) so they are unable to chat normally. (say: !gimp) (opposite: ulx ungimp)
   o ulx mute <players> - Mutes target(s) so they are unable to chat. (say: !mute) (opposite: ulx unmute)
   o ulx psay <player> {message} - Send a private message to target. (say: !p)
   o ulx thetime - Shows you the server time. (say: !thetime)
   o ulx tsay {message} - Send a message to everyone in the chat box. (say: @@)

-End of help
ULX version: 3.61

[Edit-Stickly Man!]- Updated to reflect ULX release v3.51
[Edit-JamminR]- Updated Stickly Man!'s update to show correct version # at end of help screen.
[Edit-Megiddo]- Updated to reflect ULX release v3.60.
[Edit-JamminR]- Updated to reflect ULX release v3.61.

« Last Edit: April 28, 2014, 08:53:39 PM by JamminR »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming