Can i have a init for one gamemode then have a different init in the same gamemode, and say at the end of the game can i switch between, or do i need to have 2 different gamemodes, also, if i need 2 different gamemodes, how would i create something so at the end of the map there can be a vote for what game mode next, and for each gamemode is a corresponding map
Prophunt has an interesting gamemode vote at the end of the round. If you want to look into that.
You could combine two game-modes, but you’d have to make a loader and un-loader for them. It would be fine if the code for both exists at the same time except overriding code. So, You’d load into your custom game-mode which is the loader and un-loader.
You loan in the files from one game-mode at the start of whatever game. After the game is over, you have to unload all of the hooks that game creates, and cleanup. Then, you load the other game-mode. Then after that, you unload everything.
The trick is knowing every function, and hook that game-mode calls, and creating an unload function which contains hook.Remove for ALL of the hooks added that way, and an override for all the GM: functions, and a remover for all persistent timers, etc…
It’s possible, but it would just be more of an annoyance / time consuming process to do ( If you want to load them dynamically )
Oh, all hooks like InitPostEntity, Initialize, etc hooks that get called that are required for those game-modes would have to be emulated by your loader game-mode.
edit: When you chanvelevel you can call CHANGELEVEL <map> [gamemode]and, to be sure that game-mode loads, do gamemode <gamemode>
Also, try Fretta?
If you don’t know how to accomplish this already, just use fretta13.
I really don’t want to use fretta, i don’t know why, i just really want to use lua,
How would i make it so that i can switch between gamemodes in game, but keep the same gamemode in the server browser list, example
Then switch between gamemodes such as darkrp, ttt, but keep the same “Anon’s Servers” as the title of the gamemode