Raised This Month: $ Target: $400
 0% 

Client sent drop


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Tender
Junior Member
Join Date: Nov 2005
Location: Sweden
Old 02-21-2006 , 08:54   Client sent drop
Reply With Quote #1

Is there a way to catch the "Client sent 'drop'"?
The client_disconnect method is called even at levelchange and I only need to catch players when they drop from server.
Tender is offline
Brad
AMX Mod X Team Member
Join Date: Jun 2004
Old 02-21-2006 , 09:54  
Reply With Quote #2

Moved from "Support/Help" forum.
Brad is offline
Charr
Senior Member
Join Date: Jul 2005
Location: Long Island, New York, U
Old 02-21-2006 , 10:01  
Reply With Quote #3

You can try to catch the client command "disconnect"
__________________
Charr is offline
Send a message via AIM to Charr Send a message via MSN to Charr
Twilight Suzuka
bad
Join Date: Jul 2004
Location: CS lab
Old 02-21-2006 , 10:40  
Reply With Quote #4

Wont work, its handled internally.
__________________
Twilight Suzuka is offline
Send a message via AIM to Twilight Suzuka Send a message via MSN to Twilight Suzuka
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 02-21-2006 , 16:57  
Reply With Quote #5

i believe by the time this is sent the client is gone and it is thus too late to run commands on them or even get their index.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
Tender
Junior Member
Join Date: Nov 2005
Location: Sweden
Old 02-23-2006 , 06:52  
Reply With Quote #6

As TKers often drop before you even manage to open the ban menu...
What I want to do is an extra ban menu from which dropped players can be banned.
The idea is to write a file containing the last 10 dropped players.

Code:
public add_dropped_player(id){     new name[32],authid[32],ip[32],text[128],num[32]     new line,len     get_user_name(id,name,31)     get_user_authid(id,authid,31)     get_user_ip(id,ip,31)     format(text,127,"^"%s^" ^"%s^" ^"%s^"", name,authid,ip)     read_file ( filename, 0, num, 31, len ) // what line to read from     line = str_to_num(num)     write_file(filename,text,line)     line++     if(line > 10) line = 1     num_to_str(line,num,32)         write_file(filename,num,0)     return PLUGIN_CONTINUE }

But if I use the client_disconnect, it will loose dropped players at mapchange as all players are disconnected.

Any suggestions?
Tender is offline
Tender
Junior Member
Join Date: Nov 2005
Location: Sweden
Old 02-24-2006 , 03:38  
Reply With Quote #7

No one knows? Is it really impossible to catch this event?
Tender is offline
Obbin
Senior Member
Join Date: Mar 2005
Location: 192.168.1.3
Old 02-24-2006 , 03:50  
Reply With Quote #8

I think it has allready has been done, look for a plugin called "ban disconnected players menu" or something. You can look at the source to see what methood it's using!
__________________
Sig(h)!
Obbin is offline
VEN
Veteran Member
Join Date: Jan 2005
Old 02-24-2006 , 06:57  
Reply With Quote #9

EDIT:

Quote:
Originally Posted by Tender
No one knows? Is it really impossible to catch this event?
It's possible but note that this event called on any drop (dropclient, disconnect, kick, timeout etc).

Code:
#include <amxmodx> public plugin_init() {     register_event("TextMsg", "disconnect", "a", "2=#Game_disconnected") } public disconnect() {     new name[32], authid[64], ip[16]     read_data(3, name, 31)     new id = get_user_index(name)     get_user_authid(id, authid, 63)     get_user_ip(id, ip, 15, 1) }
VEN is offline
Kraugh
Senior Member
Join Date: Jan 2006
Location: barrington, ri
Old 02-25-2006 , 03:22  
Reply With Quote #10

i tried the same thing as you, VEN, but by the time the event was called the player had already left the server and nothing could be retrieved about them (besides the name that is given in the event), at least for me.
__________________
"You can not restrain a fool from speaking, but nothing obliges you to listen."
Kraugh is offline
Send a message via AIM to Kraugh
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 20:25.


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