AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Client sent drop (https://forums.alliedmods.net/showthread.php?t=24399)

Tender 02-21-2006 08:54

Client sent drop
 
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.

Brad 02-21-2006 09:54

Moved from "Support/Help" forum.

Charr 02-21-2006 10:01

You can try to catch the client command "disconnect"

Twilight Suzuka 02-21-2006 10:40

Wont work, its handled internally.

Kraugh 02-21-2006 16:57

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.

Tender 02-23-2006 06:52

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 02-24-2006 03:38

No one knows? Is it really impossible to catch this event?

Obbin 02-24-2006 03:50

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!

VEN 02-24-2006 06:57

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) }

Kraugh 02-25-2006 03:22

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.


All times are GMT -4. The time now is 20:25.

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