ULX

Author Topic: Executing ULX commands on server startup  (Read 2167 times)

0 Members and 1 Guest are viewing this topic.

Offline Splitzle

  • Newbie
  • *
  • Posts: 6
  • Karma: 1
Executing ULX commands on server startup
« on: July 22, 2017, 12:01:18 PM »
How would I go about doing this? If I put "+ulx command" in the server batch file, it will not recognize it as a command since it is executed before ulx/ulib are able to load. I read that I could put a lua file in the lua/autorun/server directory and I tried my best to make one, but I am not very good at lua to begin with.

Code: [Select]
local function RandomMap ( changeTo, ply ) --No idea if these are correct or needed

RunConsoleCommand("ulx", "randommap")

end

I'm trying to do the "ulx randommap" command on startup. No errors were shown in console when I started it, so now I need help. Here is the RandomMap module if that helps.

An Error Has Occurred!

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