Quote:
Originally Posted by Bugsy
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(szKey, charsmax( szKey ), "%sCLASS", g_szAuthID[id]);
formatex(szClass, charsmax( szClass ), "%d", g_Class[id]); // Soul Master
nvault_set(g_Vault, szKey, szClass);
new szCLevel[20]
formatex(szKey, charsmax( szKey ), "%sCLEVEL", g_szAuthID[id]);
formatex(szCLevel, charsmax( szCLevel ), "%d", g_ClassLevel[id]);
nvault_set(g_Vault, szKey, szCLevel);
And loading it like this:
PHP Code:
new cLevel = crxranks_get_user_level(id3);
new szKey[40];
formatex(szKey, charsmax( szKey ), "%sCLASS", g_szAuthID[id3]);
new iClass = nvault_get(g_Vault, szKey );
formatex(szKey, charsmax( szKey ), "%sCLEVEL", g_szAuthID[id3]);
new iCLevel = nvault_get(g_Vault, szKey );
__________________