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

Run Commands before map end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
zeroibis
Veteran Member
Join Date: Jun 2007
Old 04-08-2013 , 19:08   Run Commands before map end
Reply With Quote #1

Is there a way to reliable run a command on/to a client before the map ends?

Example running in OnMapEnd() the player does not get the message.

Lets say for example I want to send a chat message to all clients right before the map changes, what event should I be hooking?
__________________
zeroibis is offline
berni
SourceMod Plugin Approver
Join Date: May 2007
Location: Austria
Old 04-08-2013 , 20:53   Re: Run Commands before map end
Reply With Quote #2

Try this event:

Code:
	"game_end"				// a game ended
	{
		"winner"	"byte"		// winner team/user id
	}
__________________
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
zeroibis
Veteran Member
Join Date: Jun 2007
Old 04-08-2013 , 21:26   Re: Run Commands before map end
Reply With Quote #3

Will test when I get a chance, thanks!
__________________
zeroibis is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-08-2013 , 21:58   Re: Run Commands before map end
Reply With Quote #4

Quote:
Originally Posted by berni View Post
Try this event:

Code:
	"game_end"				// a game ended
	{
		"winner"	"byte"		// winner team/user id
	}
Too lazy to test, but wouldn't that only be called when the game ends normally, so not on a manual map change? I say this since I assume the game_end event is when everyone freezes and the scoreboard pops up, which won't happen when the map is changed manually. Might be sufficient for the OP in any case - a manual change would only give them 3 seconds.
__________________

Last edited by 11530; 04-08-2013 at 22:10.
11530 is offline
thetwistedpanda
Good Little Panda
Join Date: Sep 2008
Old 04-08-2013 , 22:30   Re: Run Commands before map end
Reply With Quote #5

It may be game dependent, but as far as CS:S goes that's correct 11530. I don't recall any forwards existing for when a map is about to change, so short of editing stock plugins or hooking changelevel, game_end is about all you can do.
__________________
thetwistedpanda is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-08-2013 , 22:42   Re: Run Commands before map end
Reply With Quote #6

It's rather hackish, but one way would be to hook game_end and keep an eye on OnLogAction() for a string containing "changed map to".
__________________
11530 is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 04-09-2013 , 09:13   Re: Run Commands before map end
Reply With Quote #7

Quote:
Originally Posted by zeroibis View Post
Is there a way to reliable run a command on/to a client before the map ends?
Since no one's come right out and said it yet:

Which game is this for?
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
11530
Veteran Member
Join Date: Sep 2011
Location: Underworld
Old 04-09-2013 , 11:35   Re: Run Commands before map end
Reply With Quote #8

Quote:
Originally Posted by Powerlord View Post
Since no one's come right out and said it yet:

Which game is this for?
Judging from their previous posts I assumed CS:S.
__________________
11530 is offline
zeroibis
Veteran Member
Join Date: Jun 2007
Old 04-09-2013 , 20:27   Re: Run Commands before map end
Reply With Quote #9

Yea CS:S have not had a chance to test yet ended up very busy today
__________________
zeroibis is offline
minimoney1
SourceMod Donor
Join Date: Dec 2010
Old 04-09-2013 , 23:49   Re: Run Commands before map end
Reply With Quote #10

cs_win_panel_match?
__________________
Need help? PM me or add me on Steam.
My Steam




Quote:
Originally Posted by Rp.KryptoNite View Post
For some reason his Plugin never worked for me ,
@credits were added
im not stealing any plugins dude its my THING
minimoney1 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 19:28.


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