>>> GetClanMembers Function BUG - HELP!!! <<<
#1

Hi! Can somebody find why when i use /members cmd in the dialog shows just 1 member ? Helper -> +1REP


pawn Код:
CMD:members(playerid, params[]) return ShowPlayerDialog( playerid, 1, DIALOG_STYLE_MSGBOX,"Location: Members", GetClanMembers(GetPlayerClan(playerid)), "(Close)", "");

stock GetClanMembers(clan[])
{
    new clanquery[200];
    new minfo[512];
    new string[512];
    format(clanquery, sizeof(clanquery), "SELECT * FROM members WHERE clanname = '%s'", clan);
    mysql_query(clanquery);
    mysql_store_result();
    while(mysql_fetch_row_format(clanquery,"|"))
    {
        mysql_fetch_field_row(string,"playername");
        format(minfo,sizeof(minfo),"Name: %s\n",string);
    }
    mysql_free_result();
    return minfo;
}
Reply
#2

because you are fetching "playername" and it surely have only one value . Can you please show your database that you are doing this ? According to your codes mysql processing all right.
Reply
#3

Create a loop of total mysql_num_rows
or
Put value in value
format(minfo,sizeof(minfo),"%s Name: %s\n",minfo,string);
Reply
#4

Table looks like:

clanname playername playerclanrank isinclan
Killers SoNNy 4 1
Killers Mosul 1 1
Killers Doamna 1 1
Killers MuieS 1 1
Reply
#5

try what i said , i use same...
Reply
#6

Can you give me an ex with: Create a loop of total mysql_num_rows ?

EDIT: i used format(minfo,sizeof(minfo),"%s\n Name: %s\n",minfo, string);
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)