* May 20, 2013, 07:47:31 AM
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Come Chat with us live! Learn how HERE!
 
   Home   Help Search Login Register  
Pages: [1]   Go Down
  Print  
Author Topic: admin.dat  (Read 658 times)
{FN}BlueCelery2


Turrets: +0/-0
Posts: 10


« on: August 23, 2011, 04:24:42 AM »

i want to make a command for my admin.dat that does the following


cp server shutting down in 10 minutes
wait 300000
cp server shutting down in 5 minutes
wait 240000
cp server shutting down in 1 minute
wait 60000
then exec the /quit meaning this would only be done from the server window to kill the server

how would i add the /quit in plz help
Logged
Meisseli
Spam Killer
*

Turrets: +83/-25
Posts: 765


« Reply #1 on: August 23, 2011, 10:53:50 AM »

I believe the command you are looking for is killserverwiki
Logged

{FN}BlueCelery2


Turrets: +0/-0
Posts: 10


« Reply #2 on: August 23, 2011, 06:20:50 PM »

so it would be exec /killserver ?
Logged
Meisseli
Spam Killer
*

Turrets: +83/-25
Posts: 765


« Reply #3 on: August 23, 2011, 06:41:22 PM »

I believe this works still, make a cfg with everything you want to be done inside of it, then add a new command in your admin.dat with a "exec XXX.cfg".
Logged

hermxiv


Turrets: +1/-1
Posts: 39


« Reply #4 on: August 24, 2011, 09:29:59 PM »

I assume you have something like this at the moment....
Code:
[command]
command = command_name
exec    = cp server shutting down in 10 minutes; wait 300000; cp server shutting down in 5 minutes; wait 240000; cp server shutting down in 1 minute; wait 60000
desc    = Shuts down server in 10minutes, with messages.
levels = 6

And you want it to actually shut down the server at the end? If so, just add the command "killserver" to the end. E.g.

Code:
[command]
command = command_name
exec    = cp server shutting down in 10 minutes; wait 300000; cp server shutting down in 5 minutes; wait 240000; cp server shutting down in 1 minute; wait 60000; killserver
desc    = Shuts down server in 10minutes, with messages.
levels = 6

Though, I am not a fan of admin.dat commands. If I were you, I would just write it into your game.qvm. The wait command can sometimes have unwanted side effects, such as it will delay execution of further commands until it has finished, which in this case would be 10min.

You could do something like this.

Register a new cvar, ex: g_shutDownTime
In g_cmds.c add a "shutdown" cmd. When this command is issued, it will add the 10min to the current real time and broadcast the first warning.
Regularly for the difference between shutDownTime and send messages at time differences you want, eg: 5min, 1min.
Shut down the game when the difference is <= 0.

If you need help with that, I'll be glad to help you.
« Last Edit: August 24, 2011, 09:35:55 PM by hermxiv » Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC
TremPlus theme by Ingar, based on AF316 theme by Fedhog
Valid XHTML 1.0! Valid CSS!