Raised This Month: $12 Target: $400
 3% 

Reason for disconnection amxx 1.9


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-18-2019 , 00:34   Reason for disconnection amxx 1.9
Reply With Quote #1

Hello, I'm having trouble capturing the reason for the player's disconnect, below is a small plug made for testing.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "Bruno"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

public 
client_disconnected(idbool:dropMsg[], Len)
{
    
drop true
    log_amx
("%s"Msg)

And this is what I get in the log ...

In fact I can not capture the message ... it can be sleep disturbing me kkkkk

PHP Code:
L 04/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT
L 04
/18/2019 01:21:29: [test.amxxOT 
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-18-2019 , 12:06   Re: Reason for disconnection amxx 1.9
Reply With Quote #2

You can't do this:
PHP Code:
drop true 
it has no logic.

client_disconnected() is a forward, it notice you the thing that already happen.

PHP Code:
public client_disconnected(idbool:dropMsg[], Len

    if( 
drop 
        
server_printMsg 

Also, drop is false if you exit from the server by yourself.
__________________
My English is A0
E1_531G is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-18-2019 , 12:59   Re: Reason for disconnection amxx 1.9
Reply With Quote #3

Exactly! Now we get where I wanted to go, I want to know the reason for the disconnection to execute an action, if it is output of its own accord, but the message is only written if the drop is true, so I was in a dead end.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-18-2019 , 13:10   Re: Reason for disconnection amxx 1.9
Reply With Quote #4

PHP Code:
public client_disconnected(idbool:dropMsg[], Len)  
{  
    if( 
drop )  
        
server_printMsg )  // afk, timeout, overflow, kick
    
else
        
server_print"It was a player's decision to exit" // ESC on connect, disconnect/quit

__________________
My English is A0
E1_531G is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-18-2019 , 14:49   Re: Reason for disconnection amxx 1.9
Reply With Quote #5

For some reason, I'm still having problems, when I use the debug (as you did above) everything is ok, but when I add some action ... simply ignore bool: drop ...
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-18-2019 , 19:52   Re: Reason for disconnection amxx 1.9
Reply With Quote #6

Show your code
__________________
Bugsy is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-22-2019 , 09:37   Re: Reason for disconnection amxx 1.9
Reply With Quote #7

Quote:
Originally Posted by Bugsy View Post
Show your code

Sure.

PHP Code:
/* Plugin generated by AMXX-Studio */

#include <amxmodx>
#include <amxmisc>

#define PLUGIN "New Plug-In"
#define VERSION "1.0"
#define AUTHOR "arsmi"


public plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
// Add your code here...
}

public 
client_disconnected(idbool:dropmessage[], maxlen)
{
    if(
drop)
    {
        
log_amx("dropped by server")
        return 
PLUGIN_HANDLED
    
}
    else 
    {
        
log_amx("Player dropped itself")
        return 
PLUGIN_HANDLED
    
}
    return 
PLUGIN_HANDLED

Code:
L 04/22/2019 - 10:00:32: [plmenu.amxx] Kick: "iceeedR<1><STEAMxxxxxx><>" kick "iceeedR<1><STEAMxxxxxx><>"
L 04/22/2019 - 10:00:33: [tst.amxx] Player dropped itself
Another question, sometimes it is possible to get the team from whoever left "cs_get_user_team"), and sometimes it generates the error log, but this is correct? Given that in the API says "When this fires the entity player is still valid (eg is_user_connected (id) will return true), but in the networked commands will reach the client. "
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
thEsp
BANNED
Join Date: Aug 2017
Old 04-22-2019 , 10:55   Re: Reason for disconnection amxx 1.9
Reply With Quote #8

I think you can hook team change, and store players team into a global variable.
thEsp is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 04-22-2019 , 11:04   Re: Reason for disconnection amxx 1.9
Reply With Quote #9

Yes, I already do this, but the question is ... if the player is still "valid" even returning the boolean connect as true, why trying to get the player team generates the invalid player log ... does not do much sense.
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr
E1_531G
Senior Member
Join Date: Dec 2017
Old 04-22-2019 , 15:20   Re: Reason for disconnection amxx 1.9
Reply With Quote #10

Quote:
Originally Posted by iceeedr View Post
Yes, I already do this, but the question is ... if the player is still "valid" even returning the boolean connect as true, why trying to get the player team generates the invalid player log ... does not do much sense.
Try to get m_iTeam from a player ID if entity is valid:
PHP Code:
if( pev_valid(id) == team get_pdata_intidm_iTeam
__________________
My English is A0

Last edited by E1_531G; 04-22-2019 at 15:21.
E1_531G 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 10:52.


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