Garry's Mod

Garry's Mod

sv_restart (superadmin command)
59 Comments
H4PPY 14 Apr @ 1:26pm 
sv_restart
H4PPY 14 Apr @ 1:26pm 
are you kinda dumb in this addon
Cédric GÉRILLE [GiletJaune]  [author] 14 Apr @ 12:52pm 
But in the code of which add-on? That's quite the question!
H4PPY 14 Apr @ 3:15am 
well maybe you might HAVE to look in your code since yeah my gmod server aint public or port forwarded used something special
Cédric GÉRILLE [GiletJaune]  [author] 13 Apr @ 10:58am 
Well, I don't know what can be going on, since there is no server password set, as you mentioned.
H4PPY 13 Apr @ 10:54am 
no
Cédric GÉRILLE [GiletJaune]  [author] 13 Apr @ 10:48am 
And you did not see any message about a hook returning a value?! Maybe there is a hook system replacement somewhere, I do not know.
H4PPY 13 Apr @ 6:29am 
I DID
Cédric GÉRILLE [GiletJaune]  [author] 13 Apr @ 6:17am 
If nobody connects to your server, the event you want to monitor with `find_conflicts_hook_sv CheckPassword` will never fire.
H4PPY 10 Apr @ 5:08am 
its a private server i have hosted like i said with pterodactyl
H4PPY 10 Apr @ 5:08am 
why ?
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 2:29pm 
Come on, bring someone on the server if you want to see something...
H4PPY 9 Apr @ 1:55pm 
this ?: since its now fixed i think find_conflicts_hook_sv CheckPassword
Conflict test started for event name "CheckPassword"!
sv_restart
[Vermilion - Server] Saving data...
SoundEmitter: removing map sound overrides [599 to remove, 10 to restore]
Dropped H4PPY from server (Server shutting down)
Unknown command "escape"
H4PPY 9 Apr @ 1:52pm 
ok now it started
H4PPY 9 Apr @ 1:52pm 
no conflicts find_conflicts_hook_sv CheckPassword
H4PPY 9 Apr @ 1:43pm 
where is that conflict finder `?
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 1:19pm 
You can use my Conflict Finder with the event name "CheckPassword" if you want to find the add-on that is responsible for the rejection. That is, if the message provided to the client is not obvious.
H4PPY 9 Apr @ 1:13pm 
no i installed it on pterodactyl aka linux with docker
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 12:57pm 
Have you installed an add-on to only allow friends, by any chance? The one that I made, in particular. This one uses the password check event to reject incoming players.
H4PPY 9 Apr @ 12:19pm 
yes
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 12:12pm 
So what now? Still not working?
H4PPY 9 Apr @ 12:11pm 
heres the config {LINK REMOVED}
H4PPY 9 Apr @ 12:10pm 
no i changed the password to nothing
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 12:05pm 
Check the configuration files and the command line. The password is probably set in these.
H4PPY 9 Apr @ 11:48am 
well i dont put a password
Cédric GÉRILLE [GiletJaune]  [author] 9 Apr @ 11:17am 
Change the value of sv_password on your server. For an empty password, you can use a quoted value: sv_password "" . Well, that is if I remember correctly that console variable.
H4PPY 9 Apr @ 7:32am 
i get 192.168.2.182:57009: password failed.
192.168.2.182:57009: password failed.
please help
Cédric GÉRILLE [GiletJaune]  [author] 10 Sep, 2021 @ 9:15pm 
What is wrong? :steamsad:
MARK_EDINOROGLOVE 19 Feb, 2021 @ 12:24pm 
sv_restart
Commencing connection retry to 192.168.0.100:27015
Restoring gamemode to sandbox
Client sending to server with no netchannel!
SoundEmitter: removing map sound overrides [3 to remove, 0 to restore]
Connecting to 192.168.0.100:27015...
The server will restart in 0 seconds!
Please wait before coming back.
Restoring gamemode to sandbox

This is run in the game
Cédric GÉRILLE [GiletJaune]  [author] 18 Feb, 2021 @ 3:31pm 
Do you know what the retry command is?
Run it from your game, not on the server!
MARK_EDINOROGLOVE 17 Feb, 2021 @ 12:18pm 
sv_restart
Dropped MARK_EDINOROGLOVE from server (Disconnect by user.)
Dropped vandrenko from server (Disconnect by user.)
86.100.164.25:27005: password failed.
192.168.0.100:27006: password failed.
Cédric GÉRILLE [GiletJaune]  [author] 14 Feb, 2021 @ 3:23pm 
I mean when you run it yourself from the console of your game.
MARK_EDINOROGLOVE 4 Feb, 2021 @ 9:23am 
In what sense manually?
Cédric GÉRILLE [GiletJaune]  [author] 3 Feb, 2021 @ 2:16pm 
Hi! I have not started GMod in a while, that must be due to an update.
What happens when you manually use the retry console command??
MARK_EDINOROGLOVE 11 Jan, 2021 @ 1:56pm 
I have a new problem here, when I write sv_restart the server starts the report, as soon as it reaches zero, the message is displayed, the server will restart in 0 seconds! 192.168.0.100:27007: password failed is written to the server console. although there is no password on the server( what to do?
Cédric GÉRILLE [GiletJaune]  [author] 8 Jul, 2020 @ 6:57am 
Huh, on Windows here is how you do it:
:begin
srcds.exe .....
goto begin
MARK_EDINOROGLOVE 8 Jul, 2020 @ 2:28am 
Okay, but how can I edit the script then, it’s just that I have a server that opens in cmd and half of the FIG add-ons know where, but there is nothing in the addons folder, or maybe then drop the repository from github or maybe send it to discord ... ??
Cédric GÉRILLE [GiletJaune]  [author] 7 Jul, 2020 @ 9:23pm 
You should edit the script that starts the server to make it loop. If you can't then simply uninstall this add-on! ;-) I do not think I can do more.
MARK_EDINOROGLOVE 5 Jul, 2020 @ 7:12pm 
after writing the sv_restart command, the server turns off .... But it does not turn on ... What should I do ??
Cédric GÉRILLE [GiletJaune]  [author] 1 Jun, 2018 @ 12:22pm 
The RCon mechanism is a part of the srcds binary, so it only listens if it is running (and I believe it only accepts incoming connections if it is not stuck in a loop).
Also if the server is running with no loaded map (bad map specified or after using disconnect ), you can use rcon map <map_name> .
NBA YUNG LOOZ 31 May, 2018 @ 1:53am 
Is there any way you could make another command on here so it starts the server if its down? Like you connect to the server like 'rcon_address (ip)', then 'rcon password (pw)' and then rcon_start or rcon_restart if you dont have the server on your hardware and its on a friends lets say
Cédric GÉRILLE [GiletJaune]  [author] 30 Mar, 2018 @ 10:43am 
I am not a Linux user but I know that the default bash script does not restart the server on process clean exit nor on process crash.
Okay my description should be clear about this fact.
女儿 28 Mar, 2018 @ 5:34am 
Not work on dedicated server? it only shut down, not restart.
Tythegamer 14 Aug, 2017 @ 2:27pm 
Nice addon, very usefull!
Cédric GÉRILLE [GiletJaune]  [author] 13 Nov, 2016 @ 2:55am 
Because sv_cheats cannot be used in Lua (forbidden).
http://wiki.garrysmod.com/page/Blocked_ConCommands
JustPlayer 13 Nov, 2016 @ 1:45am 
why you dont use RunConsoleCommand( ) (https://wiki.garrysmod.com/page/Global/RunConsoleCommand) ^^
Cédric GÉRILLE [GiletJaune]  [author] 12 Nov, 2016 @ 11:42am 
Well, yes, but I could make it as safe as possible though.
It was basically my only way to enable sv_cheats so I tried, and I failed.
JustPlayer 12 Nov, 2016 @ 10:55am 
for RCON you need to give the console a password but if a Addon load he RCON pass then it can very fast detected as backdoor etc :3
Cédric GÉRILLE [GiletJaune]  [author] 12 Nov, 2016 @ 9:02am 
Yes, I tried a few things to force a packet loss of 100%, but it needs sv_cheats. So I tried to activate it through RCon. But it did not work and that did an endless loop...
That would have allowed me to display a waiting screen during the restart, instead of being kicked with "Server shutting down".
JustPlayer 12 Nov, 2016 @ 8:55am 
--[[ else
local rcon_address = GetConVar( "hostip" ):GetInt()
rcon_address = {
bit.band( 0xFF, bit.rshift( rcon_address, 24 ) ),
bit.band( 0xFF, bit.rshift( rcon_address, 16 ) ),
bit.band( 0xFF, bit.rshift( rcon_address, 8 ) ),
bit.band( 0xFF, rcon_address ),
}
rcon_address = table.concat( hostip, "." )..":"..GetConVar( "hostport" ):GetInt()
-- game.ConsoleCommand( 'rcon_address "'..rcon_address..'"\nnet_fakeloss 100\nrcon sv_cheats 1\nrcon net_fakeloss 100\n' )
end ]]

huh?