Bool function
Hey i have a bool function in a buymenu. I can set if he has bought a weapon to bool = 1 or 0, but how i can check, set the player can buy the thing 2 times and not more.
1 time is easy to check (bool =1 (if bool = 1 = Stop= but he should can buy something 2 times. how to do this? |
Re: Bool function
There's no third value/condition in a bool but that doesn't mean your problem can't be solved.
Instead of using a bool and setting to true, use an integer and on each buy attempt do PHP Code:
|
Re: Bool function
For an example, can you change it me in a simple weapongive script?
PHP Code:
PHP Code:
so what i have tried is to use instead of got_weapon[id], if ( ++NumBuy <= 2 ) in the public_cmdMenu. But NumBuy is undefined |
Re: Bool function
Quote:
|
Re: Bool function
Quote:
|
Re: Bool function
PHP Code:
PHP Code:
|
Re: Bool function
it says me that the symbol is undefinied :S How to fix it. I have tried to get the code to this, but it should work, because it has both switch case and there isnīt a big different^^
|
Re: Bool function
Quote:
|
Re: Bool function
Yes i just needed an example to understand it, but now i have tried to solve the problem with the example to understand all of that. But the bullsh**t donīt work :mrgreen:
|
Re: Bool function
You have to put the g_times_used[id]++ where the buying is actually happening.
|
| All times are GMT -4. The time now is 14:15. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.