I grant you an award for the most inefficient way of saving data of the year:
PHP Code:
public ePlanted(){ //, eDefused(), eExplosion(), eTargetSaved()
for(new i = 1; i <= g_iMaxPlayers; ++i){
//...
CheckLevel(i); // <---- THIS
}
}
public CheckLevel(id){
//...
SaveData(id); // <------ THIS
}
public SaveData( id ){
if(sqlv_connect(g_hVault)){
new iPos, szSave[(XPDATA * 10) + 1];
for (new i = 0 ; i < XPDATA ; i++){
iPos += formatex(szSave[iPos] ,charsmax(szSave) , "%10d" , g_XP[id][i]);
sqlv_set_data(g_hVault, g_szAuthID[id], szSave); // < ------ THIS
//seriously, why is sqlv_set_data in this loop?
}
sqlv_disconnect(g_hVault);
}
//...
}
If you don't understand, then (for example on 32 players server) in each of those functions (ePlanted, eDefused, eExplosion, eTargetSaved) you send 320 (non-threaded) queries to sql database...
__________________