05.04.2014, 10:08
PHP код:
CMD:top(playerid, params[])
{
new playerData[512], clanname[MAX_PLAYER_NAME], string[512], clankills, MySQL;
MySQL = mysql_connect("localhost", "root", "ur_database", "");
mysql_tquery(MySQL, "SELECT `clanname`, `clankills` FROM `clans` ORDER BY `clankills`");
while(cache_retrieve_row()))
{
mysql_fetch_row(playerData); // Don't know how to use it, sry
sscanf(playerData, "p<|>s[512]d", clanname, clankills);
format(string, sizeof(string), "%s\n"R"Clan: %s"W"Kills: %d", string, clanname, clankills);
//SendClientMessage(playerid, ~1, string);
ShowPlayerDialog( playerid, 1, DIALOG_STYLE_MSGBOX,"Location: Top Clans", string, "(Close)", "");
}
return 1;
}