I need help in (player_disconnect)
Good time of day
Need help with the player_disconnect event Little is known about the events themselves Can someone provide a sample code to study and understand 1. How to find out why a player left the server? Attempt 1: Code:
#pragma semicolon 1 Code:
#pragma semicolon 1 Code:
"xuid" "uint64" // player xuid |
Re: I need help in (player_disconnect)
Here's information on the player disconnect event: https://wiki.alliedmods.net/Generic_...yer_disconnect
The information you want to log is available during the event (player name, steamid, reason for disconnect). |
Re: I need help in (player_disconnect)
Quote:
Code:
"player_disconnect" // a client was disconnected Quote:
The hlmod forum gave me this example: Code:
#pragma semicolon 1 Code:
L 11/29/2020 - 'dr lex' (STEAM_1:1:**************) disconnected (reason: '') |
Re: I need help in (player_disconnect)
Try to use EventHookMode_Pre:
Code:
HookEvent( "player_disconnect", Event_Disconnect, EventHookMode_Pre ); |
Re: I need help in (player_disconnect)
Quote:
|
Re: I need help in (player_disconnect)
Add default value for reason:
Code:
event.GetString("reason", reason, sizeof(reason), "_NOREASON_"); |
Re: I need help in (player_disconnect)
Quote:
|
Re: I need help in (player_disconnect)
You could always try running on the server
Code:
developer 4 It looks like L4D2 also uses the event "player_team" for disconnects, but there is no reason attached: PHP Code:
|
Re: I need help in (player_disconnect)
Quote:
If it is not difficult to check (L4D2 game) |
Re: I need help in (player_disconnect)
I think we can do it by hooking CBaseClient:: PerformDisconnection, responsible for logging the message in console.log:
PHP Code:
My attempt:
Spoiler
PS. The topic is marked "Solved" when actually is not at all. |
All times are GMT -4. The time now is 08:50. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.