View Single Post
edon1337
Penguin Enthusiast
Join Date: Jun 2016
Location: Macedonia
Old 03-19-2017 , 08:44   Re: Knife Bounty + Secure (v1.2)
Reply With Quote #20

Quote:
Originally Posted by HamletEagle View Post
Indent your code properly. It's nice to always use { } , even for single line, but that's only my opinion. Do it how you want, but indent properly.
It's already indented?

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
if( ! ( get_pcvar_numg_iCvars] ) ) ) 
Way too many spaces. Without extra spaces code looks better and it's easier to read:
PHP Code:
if(!get_pcvar_num(g_iCvars[1])) 
Also notice that the ( after ! is not needed.
It's a style of coding, I removed the extra '('.

Quote:
Originally Posted by HamletEagle View Post
[php]
I would add a is_user_connected check in client_putinserver.
Done.

Quote:
Originally Posted by HamletEagle View Post
PHP Code:
if( attacker == victim )
return 
HAM_IGNORED 
This check looks reduntant. You can't kill yourself with the knife.
Somehow, I forgot to upload the version without that check, no idea how but I didn't have that in my latest version in desktop.

Thanks!

@Visinescu

Thanks, credits added.
__________________
edon1337 is offline