• Print

Author Topic: Restart Comamnd!  (Read 8420 times)

0 Members and 1 Guest are viewing this topic.

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Restart Comamnd!
« on: January 12, 2015, 12:25:07 pm »
Hello im posting this in suggestions because i have no idea how to make this but maybe someone could make a command that restarts the server... Ik that if you type "rcon_password <password>" and then "rcon quit" the server will restart but i dont know how to make the command know the rcon password so i guess you guys could find that out... I dont need this command i just think it would be cool!

Thanks!

Offline Zmaster

  • Full Member
  • ***
  • Posts: 235
  • Karma: 25
Re: Restart Comamnd!
« Reply #1 on: January 12, 2015, 03:46:52 pm »
Or just do this


But if you really want it in command form:
Code: Lua
  1. function ulx.restart()
  2.         RunConsoleCommand( "ulx", "rcon", "_RESTART")
  3. end
  4. local restart = ulx.command( CATEGORY_NAME, "ulx restart", ulx.restart, "!restart", false )
  5. restart:defaultAccess( ULib.ACCESS_SUPERADMIN )
  6. restart:help( "Restarts the server" )

(command tested and does work on local/LAN server)

Offline JamminR

  • Ulysses Team Member
  • Hero Member
  • *****
  • Posts: 8096
  • Karma: 390
  • Sertafide Ulysses Jenius
    • Team Ulysses [ULib/ULX, other fine releases]
Re: Restart Comamnd!
« Reply #2 on: January 12, 2015, 03:47:57 pm »
"ulx rcon <command>"?
See your ulx help from console for more info. Must be superadmin.
Some commands are blocked. We've done our best to try to allow for blocked, but some still are.

EDIT - what zmaster sniped me with.
Heck, don't even create new command. Just use ULX RCON

"Though a program be but three lines long, someday it will have to be maintained." -- The Tao of Programming

Offline XxLMM13xX

  • Sr. Member
  • ****
  • Posts: 265
  • Karma: -51
  • New to lua development
    • Twitch
Re: Restart Comamnd!
« Reply #3 on: January 13, 2015, 12:12:26 pm »
Im so sorry i did not know that _RESTART was a command i thought it was only quit... Now i feel stupid lol sorry!

  • Print