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

Solved [ H3LP ] Macro


Post New Thread Reply   
 
Thread Tools Display Modes
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-07-2018 , 01:50   Re: [ H3LP ] Macro
Reply With Quote #11

Quote:
Originally Posted by PRoSToTeM@ View Post
Code:
#define CHECK_ISPLAYER(%1)  \ do { \     if (!(1 <= %1 <= get_maxplayers())) \     { \         log_error(AMX_ERR_NATIVE, "[ZP] Invalid player index %d", %1); \         return 0; \     } else { \         break; \     } \ } while (register_plugin("", "", ""))
Now semicolon can be used.
Too hacky, just use a function instead of macro for such things.
__________________
HamletEagle is offline
PRoSToTeM@
Veteran Member
Join Date: Jan 2010
Location: Russia, Ivanovo
Old 01-07-2018 , 08:51   Re: [ H3LP ] Macro
Reply With Quote #12

Quote:
Originally Posted by HamletEagle View Post
Too hacky, just use a function instead of macro for such things.
Will log_error without return stop the execution?
__________________
PRoSToTeM@ is offline
Send a message via ICQ to PRoSToTeM@ Send a message via Skype™ to PRoSToTeM@
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-07-2018 , 08:59   Re: [ H3LP ] Macro
Reply With Quote #13

Quote:
Originally Posted by PRoSToTeM@ View Post
Will log_error without return stop the execution?
An if check + return is the proper solution.
__________________

Last edited by HamletEagle; 01-07-2018 at 09:00.
HamletEagle 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 12:03.


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