All people which working in our work
#1

Hello, me need a code which show list in SendClientMessage people which working in our work (And not online people). And their XP count.

Thanks.
Reply
#2

With MySQL.
Reply
#3

pawn Код:
mysql_function_query(dbHandle, "SELECT `name`, `xp` FROM `team` ORDER BY `xp` ASC", true, "ShowTeam", "i", playerid);
pawn Код:
public ShowTeam(playerid)
{
    new rows, fields;
    cache_get_data(rows, fields);
   
    if(rows)
    {
        new temp[9], i, name[24], xp, string[128];

        while(i < rows)
        {
            cache_get_row(i, 0, name);

            cache_get_row(i, 1, temp);
            xp = strval(temp);
           
            format(string, sizeof(string), "%s - %d exp", name, xp);
            SendClientMessage(playerid, white, string);
            i++;
        }
    }
    return 1;
}
It'll need some work to fit into your GM but I won't spoonfeed you on how to do that.
Reply
#4

Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)