Raised This Month: $ Target: $400
 0% 

Remember more values with nVault?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supertrio17
Senior Member
Join Date: May 2020
Location: Serbia
Old 06-16-2020 , 20:01   Re: Remember more values with nVault?
Reply With Quote #1

Quote:
Originally Posted by Bugsy View Post
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.
I don't really feel like using it, simply because I don't want to get includes for everyone who want's this plugin, so I ended up using something like this:
PHP Code:
    new szClass[20];
    new 
szKey[40];

    
formatex(szKeycharsmaxszKey ), "%sCLASS"g_szAuthID[id]);
    
formatex(szClasscharsmaxszClass ), "%d"g_Class[id]); // Soul Master

    
nvault_set(g_VaultszKeyszClass);

    new 
szCLevel[20]

    
formatex(szKeycharsmaxszKey ), "%sCLEVEL"g_szAuthID[id]);
    
formatex(szCLevelcharsmaxszCLevel ), "%d"g_ClassLevel[id]);

    
nvault_set(g_VaultszKeyszCLevel); 
And loading it like this:
PHP Code:
        new cLevel crxranks_get_user_level(id3);
        new 
szKey[40];
        
formatex(szKeycharsmaxszKey ), "%sCLASS"g_szAuthID[id3]);
        new 
iClass nvault_get(g_VaultszKey );
        
formatex(szKeycharsmaxszKey ), "%sCLEVEL"g_szAuthID[id3]);
        new 
iCLevel nvault_get(g_VaultszKey ); 
__________________
Contact! || Discord:
Mr_Boopsy_#2066
supertrio17 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 16:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode