Raised This Month: $158 Target: $400
 39% 

[TF2] Execute a function when the last client disconnects?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
jameless
Veteran Member
Join Date: Jan 2010
Old 10-14-2010 , 21:46   [TF2] Execute a function when the last client disconnects?
Reply With Quote #1

Is there an event I can hook for when a client disconnects? I was hoping that I could check the player count each time a player disconnects rather than every X seconds. This way when the last player disconnects I can run a function. I don't want the function to run every 60 seconds the server is empty which is why I was hoping for the event rather than using a timer.
jameless is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 10-14-2010 , 21:49   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #2

http://docs.sourcemod.net/api/index....d=show&id=390&
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
msleeper
Veteran Member
Join Date: May 2008
Location: Atlanta, Jawjuh
Old 10-14-2010 , 21:50   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #3

Wow.
__________________
msleeper is offline
jameless
Veteran Member
Join Date: Jan 2010
Old 10-14-2010 , 21:51   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #4

Thanks but I thought using that I had to pass in a particular client's index. Or can I just use that OnClientDisconnect similar to OnPluginStart? Will it fire the function regardless of who disconnects or do I need to pass in an index value?
jameless is offline
Monkeys
Veteran Member
Join Date: Jan 2010
Old 10-14-2010 , 21:52   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #5

It's a forward, so... yeah.
__________________
Get a lid on that zombie,
he's never gonna be alri-i-ight.
Oooh get a lid on that zombie,
or he's gonna feed all night.
Monkeys is offline
jameless
Veteran Member
Join Date: Jan 2010
Old 10-14-2010 , 21:54   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #6

Ok well thanks. It was the first thing I had found but continued past it when I thought it required an index value input.
jameless is offline
FaTony
BANNED
Join Date: Aug 2008
Old 10-15-2010 , 10:37   Re: [TF2] Execute a function when the last client disconnects?
Reply With Quote #7

forward is a function that host application calls by itself, not you.
FaTony 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 11:11.


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