26.09.2013, 21:10
maddinat0r, I need an answer ; I want to create a Top Players with some fields ( level, money, crimes, etc. ). The database is actually big enough ( + 500.000 accounts ). Do I have to make 3 threaded queries for all of this?
For example:
For example:
pawn Код:
// CMD:top(playerid, params)
mysql_tquery(SQL, "SELECT level FROM accounts ORDER BY level DESC LIMIT 5", "TopLevel", "d", playerid);
mysql_tquery(SQL, "SELECT money FROM accounts ORDER BY money DESC LIMIT 5", "TopMoney", "d", playerid);
mysql_tquery(SQL, "SELECT crime FROM accounts ORDER BY crime DESC LIMIT 5", "TopCrime", "d", playerid);
pawn Код:
forward TopLevel(const playerid);
public TopLevel(const playerid)
{
if(!IsPlayerConnected(playerid))
return 1;
// My Top Level Code .............
strcat(largeString, editedString);
// ......................................
return 1;
}
forward TopMoney(const playerid);
public TopMoney(const playerid)
{
if(!IsPlayerConnected(playerid))
return 1;
// My Top Money Code ........................
strcat(largeString, editedString);
// ......................................
return 1;
}
forward TopCrime(const playerid);
public TopCrime(const playerid)
{
if(!IsPlayerConnected(playerid))
return 1;
// My Top Crime Code .......................
strcat(largeString, editedString);
// ......................................
ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "Top Players", largeString, "OK", "");
return 1;
}