PDA

View Full Version : >>> GetClanMembers Function BUG - HELP!!! <<<


nGen.SoNNy
08/05/2012, 04:35 PM
Hi! Can somebody find why when i use /members cmd in the dialog shows just 1 member ? Helper -> +1REP


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;
}

Shabi RoxX
08/05/2012, 04:41 PM
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.

Niko_boy
08/05/2012, 04:58 PM
Create a loop of total mysql_num_rows
or
Put value in value
format(minfo,sizeof(minfo),"%s Name: %s\n",minfo,string);

nGen.SoNNy
08/05/2012, 05:14 PM
Table looks like:

clanname playername playerclanrank isinclan
Killers SoNNy 4 1
Killers Mosul 1 1
Killers Doamna 1 1
Killers MuieS 1 1

Niko_boy
08/05/2012, 05:18 PM
try what i said , i use same...

nGen.SoNNy
08/05/2012, 05:58 PM
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);