ULX

Author Topic: How could I check if a player ran a ULX command?  (Read 2609 times)

0 Members and 4 Guests are viewing this topic.

Offline Matsumoto

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
How could I check if a player ran a ULX command?
« 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?

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: How could I check if a player ran a ULX command?
« Reply #1 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.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.

Offline Matsumoto

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: How could I check if a player ran a ULX command?
« Reply #2 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.

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: How could I check if a player ran a ULX command?
« Reply #3 on: July 03, 2016, 05:50:18 PM »
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline Matsumoto

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: How could I check if a player ran a ULX command?
« Reply #4 on: July 03, 2016, 05:57:48 PM »
ULibCommandCalled
Thanks man, not sure how to mark this solved or something.

Offline MrPresident

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 2728
  • Karma: 430
    • |G4P| Gman4President
Re: How could I check if a player ran a ULX command?
« Reply #5 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.

Offline roastchicken

  • Respected Community Member
  • Sr. Member
  • *****
  • Posts: 476
  • Karma: 84
  • I write code
Re: How could I check if a player ran a ULX command?
« Reply #6 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.
Give a man some code and you help him for a day; teach a man to code and you help him for a lifetime.