Author Topic: Running ULX console commands properly.  (Read 4300 times)

0 Members and 1 Guest are viewing this topic.

Offline Jonas Præstegaard

  • Newbie
  • *
  • Posts: 6
  • Karma: 3
Running ULX console commands properly.
« on: June 08, 2016, 12:52:19 AM »
Hey everyone.

I'm trying to make my admins run certain commands using a menu. As party of the menu, I have something like this:

Code: [Select]
RunConsoleCommand("ulx","slay",tar:Name())
That works, but the problem is, sometimes it doesn't. Sometimes it will target multiple people with similar names, other times it wont be able to find any target(s).

ULX doesn't seem to support targeting via SteamID, so is there any other way to target a specific player, using Lua-run console commands?

Any help is appreciated :D

Offline iViscosity

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 803
  • Karma: 58
Re: Running ULX console commands properly.
« Reply #1 on: June 08, 2016, 03:55:21 AM »
I'm guessing here, as I don't really know for sure, but try using tar:Nick() instead. Just a thought and it usually works better than Name(). I could be wrong though, worth a shot
I'm iViscosity. I like gaming and programming. Need some help? Shoot me PM.

An Error Has Occurred!

array_keys(): Argument #1 ($array) must be of type array, null given