Q_snprintf(q,sizeof(q),"update maps set TerroristWins=TerroristWins+%d, CTWins=CTWins+%d where MapName = \"%s\";",stats.iTerroristVictories[i],stats.iCounterTVictories[i],pValidStatLevels[i]);
intretcode=ctx->mysql->Execute(q);
if(retcode!=0)
{
printf("Query:\n %s\n failed\n",q);
returnCUSTOMDATA_FAILED;
}
}
//Now do all weapons
for(inti=0;i<WEAPON_MAX;i++)
{
intiWeaponID=i;
//HACKHACK: Fix up incorrect data for the smoke grenades.
if(i==0&&stats.iBlackMarketPurchases[i]!=0)
{
iWeaponID=9;
}
Q_snprintf(q,sizeof(q),"update weapons set Count=Count+%d where WeaponID = %d;",stats.iBlackMarketPurchases[i],iWeaponID);
intretcode=ctx->mysql->Execute(q);
if(retcode!=0)
{
printf("Query:\n %s\n failed\n",q);
returnCUSTOMDATA_FAILED;
}
}
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy\";",stats.iAutoBuyPurchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Re-Buy\";",stats.iReBuyPurchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: M4A1\";",stats.iAutoBuyM4A1Purchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: AK47\";",stats.iAutoBuyAK47Purchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: Famas\";",stats.iAutoBuyFamasPurchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: Galil\";",stats.iAutoBuyGalilPurchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: Suit\";",stats.iAutoBuyVestHelmPurchases);
ctx->mysql->Execute(q);
Q_snprintf(q,sizeof(q),"update autobuy set Count=Count+%d where Purchase = \"Auto-Buy: Kev\";",stats.iAutoBuyVestPurchases);