Remember more values with nVault?
Hey, so I want to have nVault remember 2 values. Now it just remembers 1 of them:
PHP Code:
PHP Code:
I was thinking something like this PHP Code:
|
Re: Remember more values with nVault?
A few options:
4-byte integers you would need to store side by side in a string "434 34343 3141414" and then parse when retrieved 2-byte integers - You can fit 2 into a 4-byte integer and save as a single integer value 1-byte integers - You can fit 4 into a 4-byte integer and save as a single integer value String or float values Pack side by side, similar to the 4-byte integer way above "string1" "string2" "string3" OR use nVault Array and storing anything is simple |
Re: Remember more values with nVault?
Hey, so I didn't understand you quite well, I need something like this. First value: 1/2/3/4/5/6. Second value 1/2.
Is it problem for you to give me a simple example? |
Re: Remember more values with nVault?
All numbers in AMX-X are stored in a 4-byte cell. Each byte can hold a value between 0 and 255. So you can pack 4 0 to 255 values within 1 cell. If the values are between 1 and 6 only, you can pack more than just 4 into a cell.
For your example, you need 6 so this idea wouldn't work. I would use nVault Array, it's the simplest if you are not experienced. |
Re: Remember more values with nVault?
Code:
If you need to store multiple strings consider using nVault Array instead. It's just an include with utility functions, easy, really. |
Re: Remember more values with nVault?
Quote:
PHP Code:
PHP Code:
|
Re: Remember more values with nVault?
Quote:
|
Re: Remember more values with nVault?
Storing things side-by-side in a string like that was the only way prior to the creation of nVault Array. The nVault Array include just allows you to do it more elegantly in code, even though it's not the most efficient thing in the world.
It's not unheard of/unusual for plugins to require 3rd-party includes, so I wouldn't always rule them out. You can make your code much cleaner using nVault Array, just throwing it out there. |
| All times are GMT -4. The time now is 16:58. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.