AlliedModders

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

Diegorkable 11-14-2011 16:08

Client drop
 
Hey guys :)

Is there any forward public or register that is called when client drops (out of the game, not logging off, but drops. and please dont give me client_disconnect, cuz i want to know when a client has dropped)?

Dark Style 11-14-2011 17:02

Re: Client drop
 
Code:

public plugin_init() register_clcmd("drop", "clcmd_drop")
public drop(id)
{
}

?

Stereo 11-14-2011 17:03

Re: Client drop
 
PHP Code:

register_forward(FM_ClientDisconnect"fw_ClientDisconnect")
register_forward(FM_ClientDisconnect"fw_ClientDisconnect_Post"1


Diegorkable 11-14-2011 18:09

Re: Client drop
 
Quote:

Originally Posted by Dark Style (Post 1596596)
Code:

public plugin_init() register_clcmd("drop", "clcmd_drop")
public drop(id)
{
}

?

lol you gotta be kidding me :D
read the thread again, please.


Quote:

Originally Posted by Stereo (Post 1596597)
PHP Code:

register_forward(FM_ClientDisconnect"fw_ClientDisconnect")
register_forward(FM_ClientDisconnect"fw_ClientDisconnect_Post"1


Isn't it being called only when a player simply disconnects, but doesnt drop?

Erox902 11-15-2011 11:09

Re: Client drop
 
Quote:

Originally Posted by Diegorkable (Post 1596624)
Isn't it being called only when a player simply disconnects, but doesnt drop?

Isn't drop and disconnect exactly the same?, when you disconnect you send the command drop :?

Diegorkable 11-15-2011 13:37

Re: Client drop
 
Not really.

Disconnecting is when you want to stop playing in the server for some reason and then you just double click on another server to connect to it then you disconnect the current server you are in, and when you get kicked because of an error, or a good example for a drop would be that if you connect to a server and the cvar sv_allowdownload is 0, then you get kicked out of the game with a message saying "cannot continue without model..." and for everyone in console it says "p1Mp dropped" *and a line below it* "p1Mp has left the game", when the player just leaves it doesnt say he dropped. is there anyway to detect for example when is client getting kicked out of the server when sv_allowdownload is 0? (considering there are few which it works for, and for some it doesnt, so dont tell me to check if cvar is 0 then do something to whoever client_disconnect's)

hope you understood :D

fysiks 11-15-2011 17:24

Re: Client drop
 
If it shows in the log then you can register a log event.

Diegorkable 11-16-2011 04:32

Re: Client drop
 
When a player drops it shows in the logs "PLAYER_NAME dropped", how can I register that and get the player ID as a parameter?

Would that be good?:

PHP Code:

register_logevent("player_drop"2"1=dropped"

but if 1st arg is the player name, then how do I get his id? by getting his name then cmd_target?

Bugsy 11-16-2011 08:08

Re: Client drop
 
If all else fails, try this. You can determine if client sent 'drop', was kicked, or timed out..there may be other reasons too but I haven't experimented too much.

Diegorkable 11-16-2011 09:03

Re: Client drop
 
Looks good, I'll take a look. But do I use register_logevent correct to detect a drop?


All times are GMT -4. The time now is 08:31.

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