>>> GetClanMembers Function BUG - HELP!!! <<< - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: >>> GetClanMembers Function BUG - HELP!!! <<< (
/showthread.php?tid=340772)
>>> GetClanMembers Function BUG - HELP!!! <<< -
nGen.SoNNy - 08.05.2012
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;
}
Re: >>> GetClanMembers Function BUG - HELP!!! <<< -
Shabi RoxX - 08.05.2012
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.
Re: >>> GetClanMembers Function BUG - HELP!!! <<< -
Niko_boy - 08.05.2012
Create a loop of total mysql_num_rows
or
Put value in value
format(minfo,sizeof(minfo),"%s Name: %s\n",minfo,string);
Re: >>> GetClanMembers Function BUG - HELP!!! <<< -
nGen.SoNNy - 08.05.2012
Table looks like:
clanname playername playerclanrank isinclan
Killers SoNNy 4 1
Killers Mosul 1 1
Killers Doamna 1 1
Killers MuieS 1 1
Re: >>> GetClanMembers Function BUG - HELP!!! <<< -
Niko_boy - 08.05.2012
try what i said , i use same...
Re: >>> GetClanMembers Function BUG - HELP!!! <<< -
nGen.SoNNy - 08.05.2012
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);