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

Client disconnect check


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-10-2023 , 15:53   Client disconnect check
Reply With Quote #1

Hello, how can i check if client is disconnected when ingame? Not like he disconnects straight from loading screen, it logs me that and i dont want that, but i need to check if he disconnects from server/ingame.

Last edited by HowToRuski; 04-10-2023 at 15:53.
HowToRuski is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-10-2023 , 18:13   Re: Client disconnect check
Reply With Quote #2

Code:
#include <amxmodx> public UserJoin(id){     server_print("id[%d] joined", id) } public UserDisconnect(id){     server_print("id[%d] left", id) }
Spoiler
__________________
bigdaddy424 is offline
HowToRuski
Senior Member
Join Date: Feb 2019
Location: Hungary
Old 04-11-2023 , 09:37   Re: Client disconnect check
Reply With Quote #3

Quote:
Originally Posted by bigdaddy424 View Post
Code:
#include <amxmodx> public UserJoin(id){     server_print("id[%d] joined", id) } public UserDisconnect(id){     server_print("id[%d] left", id) }
Spoiler
Is UserJoin required? As client_putinserver is called a second or 2 before he sees the MOTD and is fully in
HowToRuski is offline
bigdaddy424
Senior Member
Join Date: Oct 2021
Location: Jupiter
Old 04-11-2023 , 09:53   Re: Client disconnect check
Reply With Quote #4

UserJoin will run after the player has chosen a team, after he pressed OK on the MOTD window.
__________________
bigdaddy424 is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 04-18-2023 , 20:09   Re: Client disconnect check
Reply With Quote #5

Quote:
Originally Posted by bigdaddy424 View Post
UserJoin will run after the player has chosen a team, after he pressed OK on the MOTD window.
"client_connect: If someone is connecting to the server.
client_putinserver: If someone see the motd of server. He's already joined."

if u need to check when a player join in a team just use the event, doesnt need to do unnecessary things

PHP Code:

new __int_PlayerConnected[33];

/*
0 = Disconnected
1 = Connected
2 = Already see the MOTD
3 = Joined in a Team
*/

public plugin_init()
{
      
register_event("TeamInfo""client_team""a");
}
public 
client_connectClient )
{
      
__int_PlayerConnected[Client]++
}
public 
client_putinserverClient )
{
      
__int_PlayerConnected[Client]++
}
public 
client_teamClient )
{
         new 
string[2];
         
read_data2string);
        
         switch(
string[0])
         {
               case 
'T''C''S':
               {
                        
__int_PlayerConnected[read_data(1)]++
               }
               default:
               {
                        return;
               }
         }
}
public 
client_disconnectClient )
{
      
__int_PlayerConnected[Client] = 0

simple

Last edited by MrPickles; 04-18-2023 at 20:57.
MrPickles is offline
mlibre
Veteran Member
Join Date: Nov 2015
Location: return PLUGIN_CONTINUE
Old 04-19-2023 , 09:08   Re: Client disconnect check
Reply With Quote #6

PHP Code:
#if AMXX_VERSION_NUM > 182
#define client_disconnect client_disconnected
#endif 
__________________
mlibre is offline
hikdol
New Member
Join Date: Apr 2023
Old 04-26-2023 , 04:51   Re: Client disconnect check
Reply With Quote #7

Hotstar VideoDownloader website is an impressive tool that helps to download videos from Hotstar web for free and in order to download videos using the same. hotstar video download online
hikdol 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 13:48.


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