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

[SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
psychonic

BAFFLED
Join Date: May 2008
Old 08-03-2009 , 08:38   [SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad
Reply With Quote #1

Function prototype:
Change
PHP Code:
public bool:AskPluginLoad(Handle:myselfbool:lateString:error[], err_max
to
PHP Code:
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 3
public APLRes:AskPluginLoad2(Handle:myselfbool:lateString:error[], err_max)
#else
public bool:AskPluginLoad(Handle:myselfbool:lateString:error[], err_max)
#endif 


Return Value:

Returning True (Success)
Change
PHP Code:
return true
to
PHP Code:
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 3
    
return APLRes_Success;
#else
    
return true;
#endif 

Returning False (Failure)
Change
PHP Code:
return false
to
PHP Code:
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 3
    
return APLRes_Failure;
#else
    
return false;
#endif 

Returning False (Silent Failure) NEW
Change
PHP Code:
return false
to
PHP Code:
#if SOURCEMOD_V_MAJOR >= 1 && SOURCEMOD_V_MINOR >= 3
    
return APLRes_SilentFailure;
#else
    
return false;
#endif 
psychonic is offline
TESLA-X4
Senior Member
Join Date: Dec 2008
Location: $Recycle.Bin
Old 08-03-2009 , 11:11   Re: [SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad
Reply With Quote #2

I think you'll need to add
Code:
#include <version>
TESLA-X4 is offline
psychonic

BAFFLED
Join Date: May 2008
Old 08-03-2009 , 11:31   Re: [SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad
Reply With Quote #3

Quote:
Originally Posted by TESLA-X4 View Post
I think you'll need to add
Code:
#include <version>
Nope. That is automatically included when you #include <sourcemod>
psychonic is offline
DaFox
Senior Member
Join Date: Mar 2005
Old 08-03-2009 , 14:57   Re: [SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad
Reply With Quote #4

Good info, All of my plugins use AskPluginLoad so I will be needing this.
DaFox is offline
exvel
SourceMod Donor
Join Date: Jun 2006
Location: Russia
Old 08-12-2009 , 10:03   Re: [SNIPPET] Remove compiler warnings on SM 1.3 for plugins that use AskPluginLoad
Reply With Quote #5

Very interesting. Thank you.
__________________
For admins: My plugins

For developers: Colors library
exvel is offline
Send a message via ICQ to exvel
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 20:50.


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