Loading a help list
#3

Quote:
Originally Posted by Stinged
Посмотреть сообщение
"u" isn't an actual thing for callbacks, it only works in sscanf.
It should be i or d (integer)

You shouldn't use a loop for that.
Just use something like this:
Код:
mysql_tquery(connection, "SELECT * FROM helplist WHERE active = 1", "helplist", "i", playerid);

forward helplist(playerid);
public helplist(playerid)
{
    new rows = cache_num_rows();
    if (!rows) 
        return SendClientMessage(playerid, -1, "No active questions.");

    new id, temp_sentby[35], tmp_wat[144];
    for (new i = 0; i < rows; i++)
    {
        id = cache_get_field_content_int(i, "ID");
        cache_get_field_content(i, "sentby", temp_sentby); 
        cache_get_field_content(i, "wat", temp_wat);

        format(temp_wat, sizeof (temp_wat), "{FFFFFF}[{6f757d}Help ID%d{FFFFFF}] {6f757d}%s{FFFFFF}:'{6f757d}%s{FFFFFF}'",id,temp_sentby,temp_wat);
        SendClientMessage(playerid, color, temp_wat);
    }
    return 1;
}
Thanks, but i now get absolutely spammed, even tho i have 1 active question open xd.
Reply


Messages In This Thread
Loading a help list - by justjamie - 27.06.2016, 17:07
Re: Loading a help list - by Stinged - 27.06.2016, 17:40
Re: Loading a help list - by justjamie - 27.06.2016, 18:33
Re: Loading a help list - by Stinged - 27.06.2016, 18:43
Re: Loading a help list - by justjamie - 27.06.2016, 18:52
Re: Loading a help list - by Stinged - 27.06.2016, 18:57
Re: Loading a help list - by justjamie - 27.06.2016, 19:14
Re: Loading a help list - by Logic_ - 27.06.2016, 20:01

Forum Jump:


Users browsing this thread: 3 Guest(s)