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

[HELP] Difference between client_disconnect and client_disconnected?


Post New Thread Reply   
 
Thread Tools Display Modes
shauli
Member
Join Date: Jun 2018
Old 08-09-2018 , 14:24   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #11

Quote:
Originally Posted by Black Rose View Post
It's easy, use the 1.8.2 includes.



Like Arkshine said previously the headers differ which unfortunately means you can't just replace it using a #define.
This won't work?
In amxmodx.inc:
PHP Code:
#define client_disconnect(%1) client_disconnected(%1, bool:drop, message[], maxlen)

//#pragma deprecated Use client_disconnected() instead.
//forward client_disconnect(id); 
BTW from what I remember, client_disconnected didn't work properly for me when I used fake clients created by the plugins, but i'm pretty sure this bug is already fixed.
shauli is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-09-2018 , 14:35   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #12

Quote:
Originally Posted by shauli View Post
This won't work?
In amxmodx.inc:
PHP Code:
#define client_disconnect(%1) client_disconnected(%1, bool:drop, message[], maxlen)

//#pragma deprecated Use client_disconnected() instead.
//forward client_disconnect(id); 
BTW from what I remember, client_disconnected didn't work properly for me when I used fake clients created by the plugins, but i'm pretty sure this bug is already fixed.
just comment only pragma and it wont show it as deprecated but if you want use client_disconnected then theres no needed to transform disconnect to disconnected by #define, just edit your code cause it still will require code recompilation;
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted is offline
PurposeLessx
Senior Member
Join Date: Jun 2017
Old 08-09-2018 , 15:38   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #13

As Developers say,
Quote:
This function has been deprecated, do NOT use it
Reason: This function does not catch all cases.
Why do you still use client_disconnect? Afaik and test, client_disconnected works perfect.
Do not need define client_disconnect to client_disconnected. Use it directly.
__________________
A plugin that is needed for every server.
PHP Code:
public client_connect(id)
{
    if(
get_user_iq(id) < 80)
    {
        
server_cmd("kick #%d 'You have kicked from the server because your IQ is not high enough'"get_user_userid(id));
    }

PurposeLessx is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-09-2018 , 17:53   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #14

Quote:
Originally Posted by Black Rose View Post
Sorry for the accusations. If compatibility is not broken it is at least as good as 1.8.2, which is fine.
I know you are working hard to keep this project alive. Keep on keeping on.
AMXX will be always backward compatible. It's because this way it's popular and it's working fairly well.
Next version has a lot of changes, it may be possible that it includes some unforeseen behavior changes, but usually if reported it's fixed right away.
__________________
Arkshine is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 08-10-2018 , 11:35   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #15

Quote:
Originally Posted by PurposeLessx View Post
As Developers say,


Why do you still use client_disconnect? Afaik and test, client_disconnected works perfect.
Do not need define client_disconnect to client_disconnected. Use it directly.
https://www.amxmodx.org/newstats.php...d=0&addon_id=1
All code I write should be compiling from this website and still work 100% on both 1.8.2 AND 1.8.3 even with 1.8.3 specific features as long as they are not required for the core function of the plugin.

If disconnect() was replaced with the new code it would require no action and not even a recompilation.
Now both version have to be hooked and also double execution has to be prevented by the plugin author to ensure compatibility between 1.8.2 and 1.8.3.

Spoiler
__________________

Last edited by Black Rose; 08-10-2018 at 12:26.
Black Rose is offline
CrAzY MaN
Senior Member
Join Date: Mar 2017
Location: India
Old 08-10-2018 , 12:36   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #16

+1 @Black Rose
I feel like @Black Rose is correct.
__________________
CrAzY MaN is offline
adska
Junior Member
Join Date: Jul 2018
Old 08-14-2018 , 02:13   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #17

I am using the newest AMX version, but there is no client_disconnected method at all. client_disconnected method is not included in amxmodx.inc. at this moment i use client_disconnect in my plugin, it is also not called on mapchange for me, but my problem is that i need to know disconnection reason.
adska is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-14-2018 , 05:04   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #18

Quote:
Originally Posted by adska View Post
I am using the newest AMX version, but there is no client_disconnected method at all. client_disconnected method is not included in amxmodx.inc. at this moment i use client_disconnect in my plugin, it is also not called on mapchange for me, but my problem is that i need to know disconnection reason.
You need to use the beta version if you want client_disconnected(1.8.3): https://www.amxmodx.org/snapshots.php
For 1.8.2 you can use orpheu if you need to know the disconnect reason.
__________________

Last edited by HamletEagle; 08-14-2018 at 05:05.
HamletEagle is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-14-2018 , 21:15   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #19

In most case, you won't need the new version. I don't ever plan to use it (especially since 1.8.3 will never be released).
__________________

Last edited by fysiks; 08-14-2018 at 21:16.
fysiks is offline
Ghosted
Veteran Member
Join Date: Apr 2015
Location: Georgia
Old 08-15-2018 , 06:09   Re: [HELP] Difference between client_disconnect and client_disconnected?
Reply With Quote #20

Quote:
Originally Posted by fysiks View Post
especially since 1.8.3 will never be released.
huh?
__________________

[MOD] CS Weapon Mod V1.7.1
[MM] MetaMod-C V1.0
[MOD] CS NPC Mod (5%)


Probably Left AM
Ghosted 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:14.


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