Author Topic: ULib.ucl.addUser VS. game.ConsoleCommand( "ulx adduserid [id] [rank]")  (Read 2671 times)

0 Members and 1 Guest are viewing this topic.

Offline emilhem

  • Newbie
  • *
  • Posts: 21
  • Karma: 3
What's the difference?

ULib.ucl.addUser(ply:SteamID(), {}, {}, ply.promote)

-- vs --

game.ConsoleCommand( "ulx adduserid "..ply:SteamID().." "..ply.promote)


or is there an even better way?

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: ULib.ucl.addUser VS. game.ConsoleCommand( "ulx adduserid [id] [rank]")
« Reply #1 on: December 23, 2012, 07:28:25 AM »
Ulib.ucl.addUser is more raw.
It doesn't require the TINY bit more overhead of ULX checks/balances.
It would be the most efficient way (if wanting ULib to control your group access)
It wouldn't log to your ULX logs "Console added user to group"

game.ConsoleCommand method requires ULX, so therefore, has a nano-milliseconds of overhead.
Logs to the ULX log files.
Also, you don't show it, it requires a line feed after the command "\n" (true if you're running a ULX command or not)

Those are the differences I can think of.
"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming