Raised This Month: $ Target: $400
 0% 

hook mapchange before client_disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
sparkey
Senior Member
Join Date: May 2010
Old 08-07-2011 , 21:25   hook mapchange before client_disconnect
Reply With Quote #1

Hello,

Is there any way to hook a mapchange event before the client_disconnect function is called? I only want code to be executed if the client is really retrying or disconnecting and not if the map is changed.

I have tried with the following events but none of them seems to be hooked before the client_disconnect function.
PHP Code:
register_srvcmd("changelevel""call_mapchange");

register_forward(FM_ChangeLevel"call_mapchange");

register_forward(FM_ServerDeactivate"call_mapchange"); 
best regards
sparkey is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 08-07-2011 , 22:12   Re: hook mapchange before client_disconnect
Reply With Quote #2

plugin_end()
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-07-2011 , 23:53   Re: hook mapchange before client_disconnect
Reply With Quote #3

Quote:
Originally Posted by Exolent[jNr] View Post
plugin_end()
Tried that also but the client_disconnect function gets called before.
sparkey is offline
jim_yang
Veteran Member
Join Date: Aug 2006
Old 08-08-2011 , 00:09   Re: hook mapchange before client_disconnect
Reply With Quote #4

as for the amxx design, client_disconnect is always executed before other forwards in server deactivating. Although FM_ServerDeactivate should be executed before client_disconnect(), but fakemeta executes after amxx core, so it still be executed even after plugin_end(). You can edit meta_api.cpp in amxx, add a forward yourself, right before client_disconnect forward in C_ServerDeactivate function.
__________________
Project : CSDM all in one - 99%
<team balancer#no round end#entity remover#quake sounds#fake full#maps management menu#players punishment menu#no team flash#colored flashbang#grenade trails#HE effect#spawn protection#weapon arena#weapon upgrade#auto join#no weapon drop#one name>
jim_yang is offline
sparkey
Senior Member
Join Date: May 2010
Old 08-08-2011 , 02:05   Re: hook mapchange before client_disconnect
Reply With Quote #5

Thanks alot!
sparkey is offline
Hunter-Digital
Veteran Member
Join Date: Aug 2006
Location: In the Game [ro]
Old 08-08-2011 , 05:09   Re: hook mapchange before client_disconnect
Reply With Quote #6

Doesn't SVC_INTERMISSION also call before the map ends, just when the scoreboard is forced upon clients ?
__________________
Hunter-Digital is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-08-2011 , 08:12   Re: hook mapchange before client_disconnect
Reply With Quote #7

Quote:
Originally Posted by Hunter-Digital View Post
Doesn't SVC_INTERMISSION also call before the map ends, just when the scoreboard is forced upon clients ?
It is called <mp_chattime> seconds before mapchange. But, I guess that could be an acceptable method in this case.
__________________
fysiks is offline
Reply


Thread Tools
Display Modes

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 03:20.


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