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

Quote:
Originally Posted by HamletEagle View Post
It's a thing everywhere.

About braces, you need to be consistent. I still see single instruction blocks without them.

I didn't notice before, but the same logic issue is present here:
PHP Code:
    if( ! ( is_user_connectediAttacker ) || is_user_connectediVictim ) ) )
    return 
HAM_IGNORED
There's still an error in fw_HamSpawnPost.
Let's assume the plugin is turned on and players can secure their money. Someone secures his money and he doesn't die that round, so he still has g_bHasSafety true. Now, at the end of the round knife_bounty_secure is set to 0.
When fw_HamSpawnPost is called the if check will fail, and g_bHasSafety will not reset, meaning player will be able to have his moneys secured for all rounds as long as he doesn't die.

Probably the best layout for this functions is:
Code:
alive check and plugin enabled check
reset g_bHasSafety
knife_bounty_secure check
print SECURE_AD
Updated, let me know if there's still something you want me to correct.
__________________
edon1337 is offline