Raised This Month: $ Target: $400
 0% 

Send command on disconnect


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
tyin
Member
Join Date: Jun 2011
Location: Macedonia
Old 11-17-2012 , 12:50   Send command on disconnect
Reply With Quote #1

Is it possible to send command on player when he disconnect?

ex.
PHP Code:
public client_connect(id)
{
    
client_cmd(id"cl_whatever 1");
}

public 
client_disconnect(id)
{
    
client_cmd(id"cl_whatever 0");

tyin is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-17-2012 , 12:51   Re: Send command on disconnect
Reply With Quote #2

Nope, the client has already disconnected when client_disconnect is called
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
ConnorMcLeod
Veteran Member
Join Date: Jul 2006
Location: France (95)
Old 11-17-2012 , 12:59   Re: Send command on disconnect
Reply With Quote #3

Also, you have to ask players with a menu before you change their setting, even if you set their setting back at a time.
__________________
- tired and retired -

- my plugins -
ConnorMcLeod is offline
tyin
Member
Join Date: Jun 2011
Location: Macedonia
Old 11-17-2012 , 13:01   Re: Send command on disconnect
Reply With Quote #4

damn... I thought this way we will be able to use slowhacking. When player connect server will edit his resource then when he will disconnect server will rewrite steam's default resource... but nothing of this xd thanks anyway guys
tyin is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 11-17-2012 , 13:59   Re: Send command on disconnect
Reply With Quote #5

There is no legitimate way to slowhack people, IMO.
__________________
fysiks is offline
tyin
Member
Join Date: Jun 2011
Location: Macedonia
Old 11-17-2012 , 17:50   Re: Send command on disconnect
Reply With Quote #6

And what about editing disconnect command?

PHP Code:
#include <amxmodx>

public plugin_init() 
{
    
register_plugin("""""");
    
    
register_concmd("disconnect""cmdEdit");
}

public 
cmdEdit(id
{
    
client_cmd(id"whatever 0");
    
//and something to kick user from server without any announce


Last edited by tyin; 11-17-2012 at 17:50.
tyin is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 11-17-2012 , 19:08   Re: Send command on disconnect
Reply With Quote #7

try this....

on player connect.. show menu to ask permission to change settings ( if it is needed for your sever plugins )

then on player disconnect... IF POSSIBLE

show menu to change settings back to there normal...

only problem is when people disconnect... i press esc button which opens up the cs gui.... which means player wont see an ingame menu...

so prolly very difficult.....
Blizzard_87 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 11-17-2012 , 20:15   Re: Send command on disconnect
Reply With Quote #8

It is not possible to execute ANY command on the client when they disconnect as once the server is notified about the disconnection, it is too late as the client has already severed its connection. You can also not hook the disconnect command as it is handled Client Side.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou 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:50.


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