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

Stop sound on disconnect?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-03-2009 , 23:42   Stop sound on disconnect?
Reply With Quote #1

Code:
public client_disconnect(id) {     new const iIndex = id - 1     if (g_bRadioToggle[iIndex])     {         remove_task(g_iRadioTaskID[iIndex], 0)         emit_sound(id, CHAN_AUTO, g_szSound[iIndex], VOL_NORM, ATTN_NORM, SND_STOP, PITCH_NORM)         g_bRadioToggle[iIndex] = false     } }

Doesn't seem to work.
Spunky is offline
Send a message via AIM to Spunky
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-04-2009 , 00:17   Re: Stop sound on disconnect?
Reply With Quote #2

I was under the impression that you can not do anything to the client on client_disconnect() and only do things on the server relating to the client because they are, as it implies, disconnected.
__________________
fysiks is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-04-2009 , 04:28   Re: Stop sound on disconnect?
Reply With Quote #3

Ok, makes sense. But is there a method, like Ham, where you can hook before they disconnect?
Spunky is offline
Send a message via AIM to Spunky
Sn!ff3r
Veteran Member
Join Date: Aug 2007
Location: Poland
Old 05-04-2009 , 07:17   Re: Stop sound on disconnect?
Reply With Quote #4

client_disconnect is post forward.
__________________
Join US - custom Zombie Server - Custom Addons:



Sn!ff3r is offline
Send a message via Skype™ to Sn!ff3r
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 05-04-2009 , 07:39   Re: Stop sound on disconnect?
Reply With Quote #5

You could try using FM_ClientDisconnect.
Arkshine is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 05-04-2009 , 07:48   Re: Stop sound on disconnect?
Reply With Quote #6

I think this forward is sent to tell the game that a player has disconnect.
If your internet shuts down for example, the server will be inform after it.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-04-2009 , 08:43   Re: Stop sound on disconnect?
Reply With Quote #7

Quote:
Originally Posted by Sn!ff3r View Post
client_disconnect is post forward.
Thanks for telling me what I already knew, hence the existence of this thread.

Quote:
Originally Posted by arkshine View Post
You could try using FM_ClientDisconnect.
Didn't work.
Spunky is offline
Send a message via AIM to Spunky
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-04-2009 , 09:41   Re: Stop sound on disconnect?
Reply With Quote #8

just forwards called when player is already actually disconnected, and there no way to hook before dc (maybe hooking teaminfo, and check if its unasigned and not just cnnected)
__________________
xPaw is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-04-2009 , 19:06   Re: Stop sound on disconnect?
Reply With Quote #9

I imagine if you could catch it and do what you want then you would be able to deny a disconnect .
__________________
fysiks is offline
Spunky
Senior Member
Join Date: May 2008
Location: Orlando, Fl.
Old 05-04-2009 , 20:27   Re: Stop sound on disconnect?
Reply With Quote #10

But I'm not trying to block a disconnect. IT'S NOT FAIR! Haha.
Spunky is offline
Send a message via AIM to Spunky
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:43.


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