Raised This Month: $ Target: $400
 0% 

Client disconnected


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
666
Senior Member
Join Date: Mar 2015
Old 08-14-2021 , 17:10   Client disconnected
Reply With Quote #1

I'm trying to message all players when a player disconnects from the server and the reason, but it doesn't show me any messages when a player disconnects.

żI am doing something wrong or there is an error with amx?

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

#include <amxmodx>
#include <amxmisc>

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


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

public 
client_disconnected(idbool:dropmessage[], maxlen)
{
    if ( 
drop )
    {
        new 
Name[MAX_NAME_LENGTH];
        
get_user_name(idNamecharsmax(Name));
        
        
client_print_color(0print_team_grey"^4%s ^3has left the game ^4(%s)"Namemessage);
    }

__________________
666 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-14-2021 , 17:34   Re: Client disconnected
Reply With Quote #2

Are you using an AMX-X version that supports it?

It works for me: bugsy has left the game (Client sent 'drop')

To confirm this, add: public client_disconnect(id){}

And you should see a compiler warning: Warning: Symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead. on line 18
__________________

Last edited by Bugsy; 08-14-2021 at 17:35.
Bugsy is offline
666
Senior Member
Join Date: Mar 2015
Old 08-14-2021 , 18:28   Re: Client disconnected
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
Are you using an AMX-X version that supports it?

It works for me: bugsy has left the game (Client sent 'drop')

To confirm this, add: public client_disconnect(id){}

And you should see a compiler warning: Warning: Symbol "client_disconnect" is marked as deprecated: Use client_disconnected() instead. on line 18

This is the version, what could be happening
PHP Code:
stock const AMXX_VERSION_STR[] = "1.9.0.5281"
__________________
666 is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-14-2021 , 18:46   Re: Client disconnected
Reply With Quote #4

Is the above exactly what you are using? or is this only part of the plugin code?
__________________
Bugsy is offline
666
Senior Member
Join Date: Mar 2015
Old 08-15-2021 , 02:28   Re: Client disconnected
Reply With Quote #5

Quote:
Originally Posted by Bugsy View Post
Is the above exactly what you are using? or is this only part of the plugin code?
disable all plugins and just use that plugin to make sure, but the result is the same
__________________
666 is offline
Supremache
Veteran Member
Join Date: Sep 2019
Location: Egypt
Old 08-15-2021 , 03:16   Re: Client disconnected
Reply With Quote #6

Quote:
Originally Posted by 666 View Post
disable all plugins and just use that plugin to make sure, but the result is the same

You can use this plugin, because we can't help you if you dont know the reason of your problem.
__________________
Youtube.com/Supremache

Bank System [Nvault - SQL Support]
VIP System
  • If you think it's that simple, then do it yourself.

Last edited by Supremache; 08-15-2021 at 03:19.
Supremache is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 08-15-2021 , 07:49   Re: Client disconnected
Reply With Quote #7

Here use client_disconnect instead, it seems you're running an older amxmodx version which doesn't support client_disconnected on your server, to check which amxmodx version you're running on your server type amxx version in your server console.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
666
Senior Member
Join Date: Mar 2015
Old 08-16-2021 , 10:45   Re: Client disconnected
Reply With Quote #8

Quote:
Originally Posted by Natsheh View Post
Here use client_disconnect instead, it seems you're running an older amxmodx version which doesn't support client_disconnected on your server, to check which amxmodx version you're running on your server type amxx version in your server console.
good morning guys, this is the version of amxmodx
PHP Code:
AMX Mod X 1.9.0.5281 (http://www.amxmodx.org)
Authors:
        
David "BAILOPAN" AndersonPavol "PM OnoTo" Marko
        Felix 
"SniperBeamer" GeyerJonny "Got His Gun" Bergstrom
        Lukasz 
"SidLuke" WlasinskiChristian "Basic-Master" Hammacher
        Borja 
"faluco" FerrerScott "DS" Ehlert
Compiled
Jul 12 2021 05:21:26
Built from
https://github.com/alliedmodders/amxmodx/commit/5e7e1775
Build ID5281:5e7e1775
Core mode
JIT+ASM32 
__________________
666 is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 08-16-2021 , 14:46   Re: Client disconnected
Reply With Quote #9

Tested your script, it works as intended:
http://prntscr.com/1pv09bj
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]

Last edited by Shadows Adi; 08-16-2021 at 14:46.
Shadows Adi is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-16-2021 , 21:34   Re: Client disconnected
Reply With Quote #10

Quote:
Originally Posted by Shadows Adi View Post
Tested your script, it works as intended:
http://prntscr.com/1pv09bj
Samesies
__________________
Bugsy 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 02:50.


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