View Single Post
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 09-18-2018 , 12:54   Re: Knife Bounty + Secure (v1.4)
Reply With Quote #26

Quote:
Originally Posted by edon1337 View Post
Oh, yep, you're right, forgot about the operators being negated, didn't even know that was a thing in Pawn.
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
__________________
HamletEagle is offline