Server TURN OFF plugin
#1
Question 
Help please.
Is there such a ready script or command:
I write in console server (not the game) command: "shutdown" or "off".
Server print on player HUD that round is last.
And when round is finished - turn off the server (close window with dedicated server) ?

Or if this is not complicated, can anyone make such a plugin?
I think many people would have such a script would be useful.
I do not want to hurt the players on and off the server in the middle of the round.

P.S. Sorry for my bad english please.

#2
(04-03-2013, 03:45)vudik Wrote: Help please.
Is there such a ready script or command:
I write in console server (not the game) command: "shutdown" or "off".
Server print on player HUD that round is last.
And when round is finished - turn off the server (close window with dedicated server) ?

Or if this is not complicated, can anyone make such a plugin?
I think many people would have such a script would be useful.
I do not want to hurt the players on and off the server in the middle of the round.

P.S. Sorry for my bad english please.

For in the game is it !rcon killserver
in the server console is it just: killserver

X-Track

#3
(04-03-2013, 13:04)X-Track Wrote:
(04-03-2013, 03:45)vudik Wrote: Help please.
Is there such a ready script or command:
I write in console server (not the game) command: "shutdown" or "off".
Server print on player HUD that round is last.
And when round is finished - turn off the server (close window with dedicated server) ?

Or if this is not complicated, can anyone make such a plugin?
I think many people would have such a script would be useful.
I do not want to hurt the players on and off the server in the middle of the round.

P.S. Sorry for my bad english please.

For in the game is it !rcon killserver
in the server console is it just: killserver

X-Track

Learn2read.

killserver closes server. He needs to warn players before closing, also write it in console.
I will add code. wait

Code:
unsafe string MW3Console { get { IntPtr form = FindWindow("IW5 WinConsole", "Call of Duty: Modern Warfare 3 Dedicated Server"); IntPtr txtbox = FindWindowEx(form,IntPtr.Zero,"Edit",null); IntPtr console = FindWindowEx(form, txtbox, "Edit", null); StringBuilder sb = new StringBuilder(9999999); int result = SendMessageTimeout( console, 0x0D /*WM_GETTEXT*/, 9999999, sb, 10 /*SMTO_ABORTIFHUNG | SMTO_NOTIMEOUTIFNOTHUNG*/, 500, IntPtr.Zero); return sb.ToString(); } } [DllImport("user32.dll", EntryPoint = "FindWindow", CharSet = CharSet.Ansi)] public static extern IntPtr FindWindow(string className, string windowName); [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Auto)] public static extern IntPtr FindWindowEx(IntPtr parentHandle, IntPtr childAfter, string lclassName, string windowTitle); [DllImport("User32.dll", SetLastError = true)] public static extern int SendMessageTimeout( IntPtr hWnd, uint uMsg, uint wParam, StringBuilder lParam, uint fuFlags, uint uTimeout, IntPtr lpdwResult);

Then use "
Code:
if(MW3Console == "quitit") { foreach(ServerClient c in GetClients()) iprintlnbold(c, "Server will quit in some seconds"); // do wait, threading, stopwatch.... whatever Environment.Quit(0); }
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click

#4
Wouldn't MW3Console return the entire server content?

#5
(04-03-2013, 14:12)archit Wrote: Wouldn't MW3Console return the entire server content?

Uh, i forgot. But you can just skip \r\n and get last line.
C++/Obj-Cdeveloper. Neko engine wip
Steam: Click

#6
Thanks a lot for something that is not left unattended.
Even though I have minimal representation of what is done (write plugins for different server), but do not quite understand ...
From the first section of code I Compile an executable file, and the second section of the code I compile a class library?

#7
both parts of the card are for same assembly that is a class library



Possibly Related Threads…
Thread Author Replies Views Last Post
Wink Plugin with !ban !kick and !tampban clemi555 3 6,554 11-09-2013, 09:21
Last Post: clemi555
  AntiNoScope Plugin clemi555 5 7,670 11-08-2013, 19:13
Last Post: clemi555
  Our Level Fastfile is Different from the Server. CheeseToast 6 15,576 11-03-2013, 17:52
Last Post: CheeseToast
  Dedicated Server External (public) IP Nerus 3 9,597 11-02-2013, 14:16
Last Post: Casper
  MW3 Server Version superg1973 7 17,538 10-28-2013, 01:15
Last Post: kotyra972
  Help Modifying plugin maverigh 5 7,709 10-19-2013, 10:29
Last Post: Nekochan
Shocked [Request] Switch plugin axel-le-meilleur 6 8,378 10-19-2013, 06:59
Last Post: iRoNinja
  Help how to turn off map in dedicated server pero123 8 9,638 10-15-2013, 19:00
Last Post: Nekochan
  Issue with server addon and NAT dimitrifrom31 3 8,196 10-08-2013, 18:11
Last Post: iRoNinja
  GETTING SERVER ONLINE raym 6 9,214 09-28-2013, 22:42
Last Post: Nekochan

Forum Jump:


Users browsing this thread:
1 Guest(s)

Forum Powered By MyBB, Theme by © 2002-2026 Melroy van den Berg.