[MySQL] Top Online
#4

use cache_get_data(rows, fields);

example
pawn Код:
mysql_tquery(mysql, "SELECT `Hour`, `Min`, `Sec`, `Username` FROM `players` ORDER BY `Hour`, `Min`, `Sec` DESC LIMIT 10", "OnTopOnline", "d", playerid);

forward OnTopOnline(playerid);
public OnTopOnline(playerid)
{
    new full_info[600];
    cache_get_data(rows, fields);
    if(!rows) return SendClientMessage(playerid, -1, "No row found");
    for(new i, j = rows; i < j ; i++)
    {
        new username[MAX_PLAYER_NAME + 1], hour, sec, min2, sub_info[500];
        cache_get_field_content(i, "Username", username);
        hour = cache_get_field_content_int(i, "Hour"l);
        min2 = cache_get_field_content_int(i, "Min");
        sec = cache_get_field_content_int(i, "Sec");
        format(sub_info, sizeof sub_info, "%d. Username: %s, Time: (%d|%d|%d)\n", i, username, hour, min2, sec);
        strcat(full_info, sub_info);
    }
    ShowPlayerDialog(playerid, DIALOG_TOPSTATS, DIALOG_STYLE_MSGBOX, "Top Online", full_info, "Close", "");
    return 1;
}
Reply


Messages In This Thread
[MySQL] Top Online - by ReD_HunTeR - 22.02.2015, 05:48
Re: [MySQL] Top Online - by Naresh - 22.02.2015, 05:51
Re: [MySQL] Top Online - by CalvinC - 22.02.2015, 06:10
Re: [MySQL] Top Online - by JeaSon - 22.02.2015, 07:43
Re: [MySQL] Top Online - by ReD_HunTeR - 22.02.2015, 07:52
Re: [MySQL] Top Online - by Extremo - 22.02.2015, 08:00
Re: [MySQL] Top Online - by JeaSon - 22.02.2015, 09:15
Re: [MySQL] Top Online - by Vince - 22.02.2015, 09:50
Re: [MySQL] Top Online - by Extremo - 22.02.2015, 09:52

Forum Jump:


Users browsing this thread: 3 Guest(s)