Code:
DajPkt(ilepkt)
{
new String:sqlstring[255];
Format(sqlstring, sizeof(sqlstring), "SELECT steamid FROM gocs_pkt WHERE ingame <> 0")
SQL_LockDatabase(dbcon);
new Handle:sql3 = SQL_Query(dbcon, sqlstring);
if( sql3 != INVALID_HANDLE ) // add this (with curly brackets)
{
while(SQL_FetchRow(sql3))
{
SQL_UnlockDatabase(dbcon);
new String:sid[50];
SQL_FetchString(sql3, 0, sid, sizeof(sid)); // fix
//CloseHandle(sql3); // remove this
//SQL_UnlockDatabase(dbcon); // and this
Format(sqlstring, sizeof(sqlstring), "UPDATE pfields_content SET eco_points = eco_points + %d, eco_worth = eco_worth + %d WHERE %s = '%s'", ilepkt, ilepkt, sidpole, sid);
SQL_TQuery(dbconipb, sqlstring); // fix
}
SQL_UnlockDatabase(dbcon); // moved up
CloseHandle(sql3); // moved down
}
else
SQL_UnlockDatabase(dbcon); // new!!
}
but it looks pretty bad.