Originally Posted by Bugsy
I guess, but it looks sloppy being inconsistent.
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?
// LOAD STATTRAK SKINS to USER ID
formatex(szKey, charsmax(szKey), "%s-STTK", auth);
if(nvault_get_array(vault_stattrak_id, szKey, userSTATTRAK[id][ePlayerStattrak:0], sizeof(userSTATTRAK)))
for(new i = 1; i < 100; i++)
stattrak[i][id] = userSTATTRAK[id][pdStatTrak][i];
kill[i][id] = userSTATTRAK[id][pdStatTrakKills][i];
I store data like this:
1. level, xp, money, cases and keys.
2. skins that player owns.
3. stattrak skins that player owns + kills of that stattrak.
4. skins that player have in use.
I have changed all my declarations to be var[id][i] and I have checked every line of code and everything looks fine, data is saving for all players. The problem is because I guess beeing a ton of data saved, when there are more than 10 players for example on server and change map, the data is missing for some players, not for all, maybe data is exceeded or idk...
Anyway, I will try to save with SQL, maybe you can give me an example or I will find some tut regarding this kind of save.