nVault Help
People, can someone give me an example of how I can save something in nVault through a given value? I see a lot of using "i++" to save automatically but I would like to save it manually through certain values (if this is possible) example:
PHP Code:
I'm doing this because of a cost definition of each weapon. If the player buys a weapon, it is saved in the nvault and you do not have to buy it again if you have it. |
Re: nVault Help
you can combine it with bits if you ever heard of it. it also depends how many weapons you got.
|
Re: nVault Help
I would like an example please, I intend for 6 weapons.
|
Re: nVault Help
Why do you need 2 variables, M4A1_Black and HasBlack?
Why not just use 1 variable and set the variable to true if the player has black m4a1? |
Re: nVault Help
Because 1 is to save in nVault and the other is to identify if the player has it selected as the current model. If you have a better way to define this, please explain to me, have you even seen the code I sent you? I really need your help for an in-depth understanding in nvault (it's my first time using)
|
Re: nVault Help
Take a look at this and see if you can apply this in your plugin. This supports up to 32 weapons - add others to the WeaponBits and Weapons enumerators as needed.
PHP Code:
|
Re: nVault Help
So if I were to add new models I would have to edit:
PHP Code:
|
Re: nVault Help
I personally would do this, if you need a none/default option.
PHP Code:
|
Re: nVault Help
Works perfectly, I managed to implement in my plugin, I have only a few questions, is it possible to implement for other weapons in the same plugin? could this cause some error?
|
Re: nVault Help
You can do up to 31 weapons without messing anything up, just don't randomly change things and expect it to work, like you did above, for example: enum WeaponBits (<<=2)
To add more, this is all you need to do: PHP Code:
PHP Code:
|
| All times are GMT -4. The time now is 10:23. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.