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

Restarting server without "The game will restart in 1 second"


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 05-19-2010 , 17:33   Restarting server without "The game will restart in 1 second"
Reply With Quote #1

To restart the server now, I do something like:

Code:
ServerCommand("mp_restartgame 1")
...but it shows a "The game will restart in 1 second" message in the top-center of the screen.

Are there any ways to hide that message?
alongub is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-19-2010 , 17:38   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #2

em. maybe hook the message then return it?
Master53 is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 05-19-2010 , 17:54   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #3

Could you please show an example? I'm new in SourceMod scripting.
alongub is offline
Master53
Veteran Member
Join Date: Dec 2009
Old 05-19-2010 , 18:05   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #4

what game is this for?

Code:
        //Return:
        return Plugin_Handled;
Master53 is offline
Samantha
SourceMod Donor
Join Date: Feb 2010
Location: Madagascar
Old 05-19-2010 , 18:58   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #5

Just do this

Quote:

public Action:RestartGame(Client, Args)
{
decl String:CurrentMap[32]

GetCurrentMap(CurrentMap, sizeof(CurrentMap)

ServerCommand("/changemap %s", CurrentMap)
}


Oh and remember to Hook this to a command in OnPluginStart
Samantha is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 05-21-2010 , 14:56   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #6

counter strike source.

and samantharp, it will change map... not?
alongub is offline
Scone
Senior Member
Join Date: Apr 2010
Location: England
Old 05-21-2010 , 15:56   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #7

It restarts the map that is currently being played - this has the same effect as restarting the server.
__________________
Scone is offline
alongub
Veteran Member
Join Date: Aug 2009
Location: Israel
Old 05-22-2010 , 10:05   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #8

It has the same effect but I need to restart the game and not the map.
alongub is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 05-25-2010 , 07:30   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #9

You have to call the function "CleanUpMap", but this requires a signature scan pattern, I got a working one for Half Life 2: Deathmatch, I don't know if this pattern would also work for CS:S.
__________________
Why reinvent the wheel ? Download smlib with over 350 useful functions.

When people ask me "Plz" just because it's shorter than "Please" I feel perfectly justified to answer "No" because it's shorter than "Yes"
powered by Core i7 3770k | 32GB DDR3 1886Mhz | 2x Vertex4 SSD Raid0
berni is offline
rcarm
Member
Join Date: Feb 2010
Old 05-25-2010 , 18:20   Re: Restarting server without "The game will restart in 1 second"
Reply With Quote #10

Code:
"CleanUp"
{
      "library"    "server"
      "windows"    "\x83\xEC\x08\x80\xB9\x2A\x02\x00\x00\x00\x0F\x85\xBC\x00\x00\x00\x56\x6A\x00\xB9"
      "linux"        "@_ZN12CCSGameRules10CleanUpMapEv"
}
from raydan's rally race mod

http://forums.alliedmods.net/showthread.php?p=999256
rcarm 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 16:25.


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