ok so maybe writing to csstats.dat isn't the best to go about it.
What about reading directly from the MySQL database that is already storing the info?
this is what I have so far and it isn't working at all. Please forgive any obvious mistakes, I was trying anything.
Code:
public read_user_stats(id){
//if(get_cvar_num("sv_ranks")==0)
//return PLUGIN_HANDLED
//log_amx("[sqlStats] save_user_stats")
log_amx("[sqlStats] Reading %i Players", g_iMutationcount)
// sql connect
g_dbc = dbi_connect(g_host,g_user,g_pass,g_dbname,g_error,MAX_NAME_LENGTH)
if (g_dbc == SQL_FAILED)
log_amx("[sqlStats] SQL Connection Failed")
else{
// process all queries
result = dbi_query(g_dbc,"SELECT * FROM statstable WHERE kills ='%s'")
new user_kills[32]
for (new i=1;i<=dbi_num_rows(result);i++) {
dbi_nextrow(result)
dbi_result(result,"kills",user_kills[id])
console_print(id,"Value: %s",user_kills)
}
dbi_free_result(result)
return PLUGIN_HANDLED
}
// sql close
dbi_close(g_dbc)
//reset mutationcount
g_iMutationcount = 0
return 0
}
Table is "statstable", Database row is "kills".
__________________