Raised This Month: $51 Target: $400
 12% 

Simple Shutdown Command with text


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
mazdarx8
Veteran Member
Join Date: Aug 2014
Old 02-17-2016 , 05:42   Simple Shutdown Command with text
Reply With Quote #1

Hello,

I need a plugin with command /shutdown (required Z flag) which do following:

Message (in different colours)
#### SERVER RESTART #####
#### in 2 MINUTES #####
#### SERVERIP: {IP} #####


After 2 minutes server shutdown and restart automaticly*.


*if automatic restart not possible, no problem.

Can someone send me the .sp and .smx file?
Thank you

Last edited by mazdarx8; 02-17-2016 at 05:42.
mazdarx8 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 02-17-2016 , 08:58   Re: Simple Shutdown Command with text
Reply With Quote #2

sm_shutdown
Attached Files
File Type: sp Get Plugin or Get Source (simpleshutdown.sp - 315 views - 696 Bytes)
Drixevel is offline
mazdarx8
Veteran Member
Join Date: Aug 2014
Old 02-17-2016 , 09:12   Re: Simple Shutdown Command with text
Reply With Quote #3

Thank you. Will the server restart too?
mazdarx8 is offline
mazdarx8
Veteran Member
Join Date: Aug 2014
Old 02-17-2016 , 09:14   Re: Simple Shutdown Command with text
Reply With Quote #4

Is it possible to add a message before shutdown:

Message (in different colours)
#### SERVER IS RESTARTING NOW #####
#### SERVER IS BACK IN A FEW SECONDS #####
#### TYPE 'retry' IN CONSOLE TO REJOIN #####
#### visit www.xyz.com #####
#### SERVERIP: {IP} #####
mazdarx8 is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 02-17-2016 , 09:22   Re: Simple Shutdown Command with text
Reply With Quote #5

It casts the command '_exit' after 120 seconds which is 2 minutes. You could make a 2nd timer for like 5 seconds inside of the 1st timer callback and place your message there so people can read it.
Drixevel is offline
mazdarx8
Veteran Member
Join Date: Aug 2014
Old 02-17-2016 , 09:27   Re: Simple Shutdown Command with text
Reply With Quote #6

Is this correct (Didnt replace the text)

Quote:
public void OnPluginStart()
{
RegAdminCmd("sm_shutdown", Command_ShutdownServer, ADMFLAG_ROOT);
}

public Action Command_ShutdownServer(int client, int args)
{
char sIP[32];
GetConVarString(FindConVar("ip"), sIP, sizeof(sIP));
PrintToChatAll("#### SERVER RESTART #####\n#### in 2 MINUTES #####\n#### SERVERIP: %s #####", sIP);
CreateTimer(120.0, ShutdownServer);
}

public Action Command_ShutdownServer(int client, int args)
{
char sIP[32];
GetConVarString(FindConVar("ip"), sIP, sizeof(sIP));
PrintToChatAll("#### SERVER RESTART #####\n#### in 2 MINUTES #####\n#### SERVERIP: %s #####", sIP);
CreateTimer(5.0, ShutdownServer);
}


public Action ShutdownServer(Handle timer)
{
ServerCommand("_exit");
}
mazdarx8 is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 02-17-2016 , 13:26   Re: Simple Shutdown Command with text
Reply With Quote #7

Hey redwerewolf, "_restart" would be better then "_exit" ? I don't really know, I never played around much, "_restart" seems to be an alias of "_exit"... Maybe it works on Linux servers ?

PS: Your old nickname was better (kiding) !
__________________
Want to check my plugins ?
Arkarr is offline
Mitchell
~lick~
Join Date: Mar 2010
Old 02-17-2016 , 13:51   Re: Simple Shutdown Command with text
Reply With Quote #8

Quote:
Originally Posted by Arkarr View Post
Hey redwerewolf, "_restart" would be better then "_exit" ? I don't really know, I never played around much, "_restart" seems to be an alias of "_exit"... Maybe it works on Linux servers ?

PS: Your old nickname was better (kiding) !
Depends how you have your server setup?
Mitchell is offline
Drixevel
AlliedModders Donor
Join Date: Sep 2009
Location: Somewhere headbangin'
Old 02-17-2016 , 14:09   Re: Simple Shutdown Command with text
Reply With Quote #9

Quote:
Originally Posted by Arkarr View Post
Hey redwerewolf, "_restart" would be better then "_exit" ? I don't really know, I never played around much, "_restart" seems to be an alias of "_exit"... Maybe it works on Linux servers ?

PS: Your old nickname was better (kiding) !
'_exit' is what I've always used but I've been mainly using Windows.
Drixevel is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:13.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode