Ulysses

General => Developers Corner => Topic started by: Matsumoto on July 03, 2016, 06:33:58 AM

Title: How could I check if a player ran a ULX command?
Post by: Matsumoto on July 03, 2016, 06:33:58 AM
I'm making a chatbox and I want to make it so when people run commands the text has a icon in front of it, is there a way to check if a ULX command was ran? Or any ideas how I would do such?
Title: Re: How could I check if a player ran a ULX command?
Post by: roastchicken on July 03, 2016, 09:20:28 AM
A very lazy way would just be to check the first character of the chat message and see if it's an exclamation mark. Of course this will work for any text preceded by !, so if you want it to only work for valid ULX commands you're going to have to go another route.
Title: Re: How could I check if a player ran a ULX command?
Post by: Matsumoto on July 03, 2016, 09:23:27 AM
A very lazy way would just be to check the first character of the chat message and see if it's an exclamation mark. Of course this will work for any text preceded by !, so if you want it to only work for valid ULX commands you're going to have to go another route.
Doesn't take into account of console commands.
Title: Re: How could I check if a player ran a ULX command?
Post by: JamminR on July 03, 2016, 05:50:18 PM
ULibCommandCalled (http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#ULibCommandCalled)
Title: Re: How could I check if a player ran a ULX command?
Post by: Matsumoto on July 03, 2016, 05:57:48 PM
ULibCommandCalled (http://ulyssesmod.net/docs/files/lua/ulib/shared/defines-lua.html#ULibCommandCalled)
Thanks man, not sure how to mark this solved or something.
Title: Re: How could I check if a player ran a ULX command?
Post by: MrPresident on July 03, 2016, 07:03:05 PM
Thanks man, not sure how to mark this solved or something.

No need, it's a forum, not a ticketing system. :)
Other people might have the same question/issue as you and pick up the discussion or at least be able to search this thread.
Title: Re: How could I check if a player ran a ULX command?
Post by: roastchicken on July 04, 2016, 05:10:00 AM
Doesn't take into account of console commands.

Oh, I assumed you wanted to put an icon next to the command itself, not the command's output.