View Single Post
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-27-2020 , 16:31   Re: [INC] nVault Array
Reply With Quote #10

Quote:
Originally Posted by aEEk View Post
I think it's same think, it depends how you declare variables (eg: new stattrak[MAX+1][33] where max could be more than 100)...
I guess, but it looks sloppy being inconsistent.

Quote:
Originally Posted by aEEk View Post
I choosed the option to separate data because I like the code to be clean and code readable and friendly to read.

First I have used nvault, but because there is so much data to store I faced some issues that data strings can not be so longer and had to split in more strings and using strok method, etc, headacke, with nvault_array is much easier. but now I am facing this...
I think you did the complete opposite. It's much more uniform to have an enumerator define all of your constants instead of having multiple arrays floating around in your code, and indexed inconsistently var[id][i] and var[i][id]. It's easy to mess something up with code like this since you may forget how you are indexing an array and may assign a value with var[id][i] when you declared the array for var[i][id] use.

It looks like you are saving a ton of data for each player and this can likely be reduced. Can you explain what this is for?

PHP Code:
// LOAD STATTRAK SKINS to USER ID
formatex(szKeycharsmax(szKey), "%s-STTK"auth);

if(
nvault_get_array(vault_stattrak_idszKeyuserSTATTRAK[id][ePlayerStattrak:0], sizeof(userSTATTRAK[])))
{        
    for(new 
1100i++)
    {
        
stattrak[i][id]     = userSTATTRAK[id][pdStatTrak][i];
        
kill[i][id]         = userSTATTRAK[id][pdStatTrakKills][i];
    }

__________________

Last edited by Bugsy; 05-27-2020 at 16:38.
Bugsy is offline