I know it's a long shot, but I'm having an issue with MySQL. I'm not sure about the order of the stats as all the stock code works, but my custom column always shows up as 0. Only way would be to show a snippit of code:
Code:
sodstats.inc
#define STAT_SCORE 0
#define STAT_KILLS 1
#define STAT_DEATHS 2
#define STAT_HITS 3
#define STAT_SHOTS 4
#define STAT_TIME_PLAYED 5
#define STAT_HEADSHOTS 6
#define STAT_CUSTOM 7
#define MAX_STATS 8
I've just moved the custom in there as 1 more space and set max_stats to be 1 larger to facilitate for stat_custom... However in the callback I'm not getting anything for STAT_CUSTOM
sodstats.sp
Code:
public LoadPlayerCallback(const String:name[], const String:steamid[], any:stats[], any:data, error)
{
new client = data;
g_session_deaths[client] = 0;
g_session_kills[client] = 0;
g_session_hits[client] = 0;
g_session_shots[client] = 0;
g_session_score[client] = 0;
g_session_headshots[client] = 0;
g_session_custom[client] = 0;
g_time_joined[client] = GetTime();
g_last_saved_time[client] = g_time_joined[client];
if(error == ERROR_PLAYER_NOT_FOUND)
{
CreatePlayer(client, g_steamid[client]);
return;
}
Format(g_name[client], MAX_NAME_LENGTH, name);
g_kills[client] = stats[STAT_KILLS];
g_deaths[client] = stats[STAT_DEATHS];
g_shots[client] = stats[STAT_SHOTS];
g_hits[client] = stats[STAT_HITS];
g_score[client] = stats[STAT_SCORE];
g_time_played[client] = stats[STAT_TIME_PLAYED];
g_headshots[client] = stats[STAT_HEADSHOTS];
g_custom[client] = stats[STAT_CUSTOM];
g_initialized[client] = true;
LogError("[SoD-Stats] Load Player Callback Data Post-STAT_:");
LogError("[SoD-Stats] Deaths: %i", g_deaths[client]);
LogError("[SoD-Stats] Kills: %i", g_kills[client]);
LogError("[SoD-Stats] Custom: %i", g_custom[client]);
}
I understand the top half is initial session setup, so it should all be 0, but the lower portion shows the right deaths and kills, but when I go to load the custom field, which has a value I've set in the database of 50, it shows up as 0 in the error log... I really don't understand how I'm supposed to link that column with the resultset.
Any help would be greatly appreciated. I didn't think this would be such a painful experience, but I can't find anything that lets me control the select statement, or what goes into the data being passed to the callback, so I literally have no idea what's in that data