Automaticall switch gamemodes after the match ends?
8 replies, posted
I made a couple of gamemodes like Capture the Flag, Team Deathmatch, VIP, etc. Say we're playing VIP; I want to know how I can make it so at the end of the match, VIP changes to the Team Deathmatch gamemode (and if possible, without having to reload map, and keeps members on the same team).
sv_defaultgamemode "beepboop"
map "coolmap"
in console, as for team save it as a txt file or a sql or something depending on your level of skill
He said, WITHOUT reloading the map.
[QUOTE=Rago;16882125]He said, WITHOUT reloading the map.[/QUOTE]
ohhh
I believe there is some reload_gamemode command or something but thats just dirty
If you want it to work without map restart you should make all this gamemodes in one. Because there is no way to change gamemode without reloading map (atleast for already connected clients)
[QUOTE=Azalar;16882024]I made a couple of gamemodes like Capture the Flag, Team Deathmatch, VIP, etc. Say we're playing VIP; I want to know how I can make it so at the end of the match, VIP changes to the Team Deathmatch gamemode [b](and if possible, without having to reload map,[/b] and keeps members on the same team).[/QUOTE]
I don't mind reloading the map, only cared if it was possible
So any type of .txt or script or anything that reloads the map and changes gamemode at a set time limit? Or at the end of the match?
Well, "sv_gamemodeoverride gamemodenamehere" will set the new gamemode until the server completetly restart or "sv_gamemodeoverride" is changed again.
Basicaly, setting sv_gamemodeoverride to something will not change/reload the actual map, it's the gamemode that will be active on the next changelevel.
Don't mess around with the gamemode convars. There is a command just for this.
[code]changegamemode gm_construct sandbox[/code]
The only way I can think of doing this properly without reloading the map would be to use hooks (Instead of GM:Function()) - To load a gamemode you execute its code (pcall()) and add its hooks (hook.Add()) - To unload a gamemode you simply remove its hooks (hook.Remove()). This would need to be done on both client and server.
You should probably change map every so often anyway just to clean up everything.
Sorry, you need to Log In to post a reply to this thread.