Is there a way to make my server change gamemodes every hour?
#1

I was wondering, is there a way to make the gamemode change every hour, so I wouldn't have to do it manually? Thanks.
Reply
#2

Make a every_hour_timer in which you're going to use SendRconCommand function which will send rcon command to change gamemode (SendRconCommand("changemode modename");).

But if you're using same gamemode every time, you can just set one_hour_timer to restart the gamemode (SendRconCommand("gmx");).
Reply
#3

I am using 2 different gamemodes

Edit: Which area of the script do I put it in (example: OnPlayerConnect), I checked through my script, and I have a timer in GameModeInit, so I believe it goes here right?
Reply
#4

Quote:
Originally Posted by Donnie_Viper
I am using 2 different gamemodes
So you can make it like this:
In first gamemode add one hour timer when the gamemode starts by using this (don't forget the timer):
pawn Код:
SendRconCommand("changemode SecondGameModeName");
and one hour timer in other gamemode by using this (don't forget the timer):
pawn Код:
SendRconCommand("changemode FirstGameModeName");
Reply
#5

Or use a filterscript.. (that will make it less complex)
Reply
#6

It asks for a interval for the timer, what number will mean 1 Hour?
Reply
#7

Quote:
Originally Posted by Donnie_Viper
It asks for a interval for the timer, what number will mean 1 Hour?
It's in miliseconds. Once second is 1000 miliseconds, one hour is 3600 seconds.
3600 * 1000 = 3600000
Reply
#8

Quote:
Originally Posted by Donnie_Viper
It asks for a interval for the timer, what number will mean 1 Hour?
Timers are in milliseconds (1000 = 1 second)
Reply
#9

OK, thanks, it works right (well, compiled right :P), thanks for the help (now I do believe I put both if them in the server.cfg? lol)
Reply
#10

Quote:
Originally Posted by Donnie_Viper
OK, thanks, it works right (well, compiled right :P), thanks for the help (now I do believe I put both if them in the server.cfg? lol)
Put both gamemodes in folder called 'gamemodes'. In server.cfg add line 'gamemode0 FirstGameModeName'.
If you did like i told you, then after one hour the OneHourTimerFunction in FirstGameModeName will change mode to SecondGameModeName which will do the same for FirstGameModeName.
I hope it isn't too much complicated for you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)