Knife Bounty + Secure (v1.5)
2 Attachment(s)
.: Knife Bounty + Secure v1.5 :. .: Description :. When you knife a person, you will take his money (If not secured), if he is secured, you won't be able to take his money. To secure your money type /secure , it will cost you some money (Controlled by CVAR). Secure will last until Death/ New Spawn. .: CVARs :. Quote:
Spoiler
.: Requirements :.
Spoiler
.: Credits :.
Spoiler
|
Re: Knife Bounty + Secure
Could Someone Please Translate To Their Language , Thanks. :)
Quote:
|
Re: Knife Bounty + Secure
[de]
Code:
VICTIM_SECURED = [Knife Bounty] Opfer wurde gesichert! |
Re: Knife Bounty + Secure
Quote:
|
Re: Knife Bounty + Secure
Code:
[pl] |
Re: Knife Bounty + Secure
LANG_PLAYER should be used only when you print to all players at the same time. When you print to a specific player, use player id instead.
Use charsmax(). |
Re: Knife Bounty + Secure
Quote:
Quote:
|
Re: Knife Bounty + Secure (v1.1)
Not really, I would say to keep your code simple when you are a beginner. Bits are fine, but the bool is fine too and the difference is trivial.
|
Re: Knife Bounty + Secure (v1.1)
Quote:
Code:
|
Re: Knife Bounty + Secure (v1.1)
Yes. Because if x has the bool set to true, x disconnects, y connects and y gets the id of x then the bool will be true for him.
|
Re: Knife Bounty + Secure (v1.1)
Code:
[mk] |
Re: Knife Bounty + Secure (v1.1)
Quote:
Quote:
|
Re: Knife Bounty + Secure (v1.2)
Brazilian Portuguese
Code:
[bp] |
Re: Knife Bounty + Secure (v1.2)
Quote:
|
Re: Knife Bounty + Secure (v1.2)
Why? It's a translation, so why change it?
|
Re: Knife Bounty + Secure (v1.2)
Quote:
|
Re: Knife Bounty + Secure (v1.2)
gr8 idea i haven't seen anything like this made yet. good work.
|
Re: Knife Bounty + Secure (v1.2)
Romanian
Code:
[ro] |
Re: Knife Bounty + Secure (v1.2)
PHP Code:
PHP Code:
I would add a is_user_connected check in client_putinserver. PHP Code:
PHP Code:
|
Re: Knife Bounty + Secure (v1.2)
Quote:
Quote:
Quote:
Quote:
Thanks! @Visinescu Thanks, credits added. |
Re: Knife Bounty + Secure (v1.3)
I will test this as I have been lost without the bank/wire your friends or enemy's money plugin from yesteryears and love knifing. Secure is great idea.
|
Re: Knife Bounty + Secure (v1.3)
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:
2.Instead of: PHP Code:
3."if( VictimMoney == EMPTY )" EMPTY is badly named. You are checking a variable(not some kind of container), which can't be empty. Probably a better name would be NO_MONEY or ZERO_MONEY. 4.In fw_HamSpawnPost there's a potential logic error. PHP Code:
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. |
Re: Knife Bounty + Secure (v1.3)
Quote:
Quote:
And the rest are done. |
Re: Knife Bounty + Secure (v1.4)
https://en.wikipedia.org/wiki/De_Morgan%27s_laws
! also negates the operator !(a && b) is !a || !b and !(a || b) is !a && !b. |
Re: Knife Bounty + Secure (v1.4)
Quote:
|
Re: Knife Bounty + Secure (v1.4)
Quote:
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:
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 |
Re: Knife Bounty + Secure (v1.4)
Quote:
|
Re: Knife Bounty + Secure (v1.5)
Seems good.
|
Re: Knife Bounty + Secure (v1.5)
Quote:
|
Re: Knife Bounty + Secure (v1.5)
can anyone set that if any player kill other player so it dont take all money.
it just take 25%. Sorry for bad English |
All times are GMT -4. The time now is 07:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.