View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 09-18-2018 , 12:40   Re: Knife Bounty + Secure (v1.3)
Reply With Quote #23

Quote:
Originally Posted by HamletEagle View Post
For approval:

1.Even if the style is subjective, I would recommend you to use braces even when the block has only one instruction:
PHP Code:
for ( new isizeof g_sCommandListi++ )
    
register_clcmdg_sCommandList], "SecurePlayer" ) ; 
For example in my text editor(NP ++) this looks unindented(register_clcmd and for have the same level of indentation).
I don't know why Notepad can't indent blocks of codes which don't have brackets, but that looks proper too, anyways I added brackets.

Quote:
Originally Posted by HamletEagle View Post
4.In fw_HamSpawnPost there's a potential logic error.
PHP Code:
if( ! ( get_pcvar_numg_iCvars] ) || get_pcvar_numg_iCvars] ) ) ) 
This translated to !get_pcvar_num(g_iCvars[0]) && !get_pcvar_num(g_iCvars[1]). What this means is that you stop the code from being executed only if the plugin is disabled AND players can't secure their money.
In the case the plugin is enabled but knife_bounty_secure is 0 or the plugin is disabled but knife_bount_secure is 1 then the code will still execute.
You probably meant to do an OR instead of AND.
I don't see any && here? What I meant to do is disable further execution if either the plugin is disabled or money securing is disabled, anyways I updated it to be separately.

And the rest are done.
__________________

Last edited by edon1337; 09-18-2018 at 12:41.
edon1337 is offline