Raised This Month: $ Target: $400
 0% 

Plugin working on 1.8.2 but not on 1.9


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-25-2020 , 07:48   Re: Plugin working on 1.8.2 but not on 1.9
Reply With Quote #1

Quote:
Originally Posted by fysiks View Post
If using 1.8.2 you have to use client_disconnect(). If you're only using 1.9 then you can and should use client_disconnected().

If you want to support both and your code is not affected by the issues related to client_disconnect() you can either just use it as-is or you can use preprocessor code to switch between them.

Deprecated means that it still works but it's not recommended (and my be removed in a future release but I doubt that will ever happen for AMX Mod X considering how slow development is).
So something like this?
PHP Code:
#if(get_amxx_verstring <= 1.8.2)
public client_disconnect(id)
{
    
g_Class[id] = 0;
}
#endif

#if(get_amxx_verstring > 1.8.2)
public client_disconnected(id)
{
    
g_Class[id] = 0;
}
#endif 
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
alferd
Veteran Member
Join Date: Dec 2019
Location: Iran is Always Eternal
Old 06-25-2020 , 07:56   Re: Plugin working on 1.8.2 but not on 1.9
Reply With Quote #2

Code:
#if AMXX_VERSION_NUM < 190 public client_disconnect(id) #else public client_disconnected(id) #endif {         g_Class[id] = 0; }

Last edited by alferd; 06-25-2020 at 07:57.
alferd 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 16:50.


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