30.06.2011, 16:29
The OnQueryFinish for me not work good on Linux.
This freeze my server: ( Not crash, "lagg" )
My Query:
OnQueryFinish:
This freeze my server: ( Not crash, "lagg" )
My Query:
pawn Код:
mysql_query_ex("SELECT cmd, COUNT( cmd ) FROM commands GROUP BY cmd ORDER BY COUNT( cmd ) DESC LIMIT 25", THREAD_QUERY_TOPCMDS, playerid);
pawn Код:
public OnQueryFinish(sql_query[], resultid, extraid, connectionHandle)
{
if(extraid != -1)
{
switch(resultid)
{
case THREAD_QUERY_TOPCMDS:
{
new
count;
mysql_store_result();
while(mysql_fetch_row(line))
{
sscanf(line, "p<|>s[24]d", name, vID);
if(!count)
{
if(strlen(name) < 10)
{
format(dline, sizeof(dline), "%d. %s: \t\t\t%d", (count +1), name, vID);
}
else if(strlen(name) >= 10)
{
format(dline, sizeof(dline), "%d. %s: \t\t%d", (count +1), name, vID);
}
else if(strlen(name) > 14)
{
format(dline, sizeof(dline), "%d. %s: \t%d", (count +1), name, vID);
}
else if(strlen(name) > 20)
{
format(dline, sizeof(dline), "%d. %s: \t%d", (count +1), name, vID);
}
else
{
format(dline, sizeof(dline), "%d. %s: \t%d", (count +1), name, vID);
}
count++;
}
else
{
if(strlen(name) < 10)
{
format(dline, sizeof(dline), "%s\r\n%d. %s: \t\t\t%d", dline, (count +1), name, vID);
}
else if(strlen(name) >= 10)
{
format(dline, sizeof(dline), "%s\r\n%d. %s: \t\t%d", dline, (count +1), name, vID);
}
else if(strlen(name) > 14)
{
format(dline, sizeof(dline), "%s\r\n%d. %s: \t%d", dline, (count +1), name, vID);
}
else if(strlen(name) > 20)
{
format(dline, sizeof(dline), "%s\r\n%d. %s: %d", dline, (count +1), name, vID);
}
else
{
format(dline, sizeof(dline), "%s\r\n%d. %s: \t%d", dline, (count +1), name, vID);
}
count++;
}
}
mysql_free_result();
ShowPlayerDialog(extraid, 5550, DIALOG_STYLE_MSGBOX, "Legtцbbet hasznбlt parancsok..", dline, "Ok", "Mйgse");
}
}
}
return 1;
}