[SOLVED] Saving upgrades with nVault
I'm trying to save the player's upgrades with nVault.
PHP Code:
PHP Code:
PHP Code:
PHP Code:
|
Re: Saving upgrades with nVault
Could use a bitsum to record each players upgrade status and then store the resulting numerical value to nvault.
So you would have 5 upgrades as you do in your list. If the player has upgrades 1 and 3, their bitsum would look like 00000101 [1<<0 OR 1<<2] which is equal to "5". I can write this for you later. |
Re: Saving upgrades with nVault
Thank you, I would appreciate it. I'm not familiar with bitsums yet. Also, would adding an upgrade in the future affect the saved data?
|
Re: Saving upgrades with nVault
It would have no impact. This method allows up to 32 updates. If you really needed more it could be accomplished
|
Re: Saving upgrades with nVault
Good, I won't need that many.
|
Re: Saving upgrades with nVault
im wondering, if you are trying to create abilities that can be upgraded multiple times, for example upgrade health to lvl 2, lvl 3 etc how should the array be written?
|
Re: Saving upgrades with nVault
That probably won't change much, because now if you have an upgrade, the array is g_iUpgrade[id][iUpgrade] = 1, so for the next level it would just be equal to 2.
|
Re: Saving upgrades with nVault
So does each of your 5 upgrades in your original post have multiple levels, or is it just a yes/no for each?
|
Re: Saving upgrades with nVault
It's only yes/no.
|
Re: Saving upgrades with nVault
Untested
Edit: Added load\save data on authorized\disconnect. PHP Code:
|
| All times are GMT -4. The time now is 22:14. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.