29.06.2012, 17:52
As I rewrited MySQL from R6-2 to R7, I got a problem now with TOP10. For example, there is one registered player with name ABC with 100$, so the TOP10 should look like this:
But the problem is that the TOP looks like this:
The code:
I think the problem is where I put >><<, but I dont know, how to fix it.
Any solutions? Thx.
Quote:
1. ABC ($100) 2. There is no registered player 3. There is no registered player 4. There is no registered player 5. There is no registered player 6. There is no registered player 7. There is no registered player 8. There is no registered player 9. There is no registered player 10. There is no registered player |
Quote:
1. ABC ($100) 2. ABC ($100) 3. ABC ($100) 4. ABC ($100) 5. ABC ($100) 6. ABC ($100) 7. ABC ($100) 8. ABC ($100) 9. ABC ($100) 10. ABC ($100) |
pawn Код:
PUB::GetStatistic(playerid, Field[], Command[], bool: toStrval)
{
new szQuery[88];
format(szQuery, 87, "SELECT `Name`, `%s` FROM `players` ORDER BY `%s` %s LIMIT 10", Field, Field, Command);
mysql_function_query(iHandle, szQuery, true, "GetServerStatistic", "dssdd", playerid, Field, Command, Item, toStrval);
}
pawn Код:
PUB::GetServerStatistic(playerid, Field[], Command[], bool: toStrval)
{
new
szResult[1100],
szField [21],
pName [24],
iFields,
iRows;
>>>>>>>>>for (new i; i != 10; ++i)
{
cache_get_data(iRows, iFields);
if (iRows)
{
cache_get_row(0, 0, pName);
cache_get_row(0, 1, szField);
if (toStrval)
{
format(szResult, 1100, "%s{FF0000}%d. {33AA33}%s ({FF0000}%d{33AA33})\n", szResult, i + 1, pName, strval(szField));
}
else
{
format(szResult, 1100, "%s{FF0000}%d. {33AA33}%s ({FF0000}%s{33AA33})\n", szResult, i + 1, pName, szField);
}
}<<<<<<<<<<<<
else
{
format(szResult, 1100, "%s{FF0000}%d. {33AA33}Nлra\n", szResult, i + 1);
}
}
........
Any solutions? Thx.