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

Problem with triggering VGUIPanel before mapchange


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hannes96
AlliedModders Donor
Join Date: May 2013
Location: Germany
Old 06-10-2015 , 21:02   Problem with triggering VGUIPanel before mapchange
Reply With Quote #1

Hey,

I am trying to script a plugin that plays music over the html motd during a mapchange. I can already change the html motd after someone fully connected but the song just wont play before the map changes. I tried it with the event "OnMapEnd" but couldnt do "ShowVGUIPanel" anymore then because the client wasnt connected anymore.

Now me and a friend tried it with the "OnClientDisconnect" event since it is also called when the map changes but it is still not working. Anybody knows a way to get it working?
Attached Files
File Type: sp Get Plugin or Get Source (loadingmusic.sp - 200 views - 3.7 KB)

Last edited by hannes96; 06-10-2015 at 21:04.
hannes96 is offline
Dr. Api
BANNED
Join Date: Mar 2015
Location: France
Old 06-11-2015 , 04:39   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #2

Quote:
Originally Posted by hannes96 View Post
Hey,

I am trying to script a plugin that plays music over the html motd during a mapchange. I can already change the html motd after someone fully connected but the song just wont play before the map changes. I tried it with the event "OnMapEnd" but couldnt do "ShowVGUIPanel" anymore then because the client wasnt connected anymore.

Now me and a friend tried it with the "OnClientDisconnect" event since it is also called when the map changes but it is still not working. Anybody knows a way to get it working?
Interesting, I'm going to make some test.

EDIT: some test I did it's working. still keep going.

EDIT2 : https://www.youtube.com/watch?v=fuzp...56zTzlsF52g-9t
I took a youtube song. The song will be stop when the player will join but during the mapchange it's good.

EDIT3: https://forums.alliedmods.net/showthread.php?t=264189

Last edited by Dr. Api; 06-11-2015 at 06:26.
Dr. Api is offline
SoulSharD
Member
Join Date: Oct 2013
Location: United Kingdom
Old 06-11-2015 , 06:49   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #3

On a side note, if you're using YouTube to steam music; you'll also hear any advertisements.
__________________

SoulSharD is offline
hannes96
AlliedModders Donor
Join Date: May 2013
Location: Germany
Old 06-11-2015 , 10:15   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #4

I am making this plugin for my TF2 Server and your plugin isnt working for TF2. I would like to use some event that works for every game and triggers it right before the mapchange. Everything else is working, it is just that the url wont open before the map changes. Cookies are being stored and the url after the player connected is opened. Anyone could help me fixing my plugin?

Last edited by hannes96; 06-11-2015 at 10:17.
hannes96 is offline
Dr. Api
BANNED
Join Date: Mar 2015
Location: France
Old 06-11-2015 , 11:18   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #5

Quote:
Originally Posted by hannes96 View Post
I am making this plugin for my TF2 Server and your plugin isnt working for TF2. I would like to use some event that works for every game and triggers it right before the mapchange. Everything else is working, it is just that the url wont open before the map changes. Cookies are being stored and the url after the player connected is opened. Anyone could help me fixing my plugin?
I don't know how TF2 works but I'm sure you have some event before map change: https://wiki.alliedmods.net/Team_For...rena_win_panel
Dr. Api is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 06-11-2015 , 12:01   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #6

In TF2, the event that fires before the map changes is game_end. However, things like changelevel (and SourceMod's ForceChangeLevel) will not fire that.
__________________
Not currently working on SourceMod plugin development.
Powerlord is offline
ShadowManGer
Member
Join Date: May 2013
Old 06-11-2015 , 15:37   Re: Problem with triggering VGUIPanel before mapchange
Reply With Quote #7

Quote:
Originally Posted by Powerlord View Post
In TF2, the event that fires before the map changes is game_end. However, things like changelevel (and SourceMod's ForceChangeLevel) will not fire that.
That's why the "OnClientDisconnected" forward is used. Because it will also be called before the map change and even before force map change.
The "client_disconnected" event is hooked to disable the sound for the client, because the event is fired before the "OnClientDisconnected" forward will be called, as far as i know.

So the question is, why can't the client hear the sound/music although the VGUIPanel is open for the client?
ShadowManGer 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 02:36.


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