03.01.2019, 20:12
I want get online clan members but i dont know how to create the function to get online clan members from mysql. I use clan.inc
this show the all clan members:
this show the all clan members:
pawn Code:
COMMAND:ocmembers(playerid, params[])
{
if(IsPlayerAnyClanMember(playerid) && GetPlayerClanRank(playerid) >= 5)
{
new MSG[256];
format(MSG, sizeof(MSG), "%s",GetClanMembers(GetPlayerClan(playerid)));
Dialog_Show(playerid, dialogUnused, DIALOG_STYLE_MSGBOX, "Offline Clan Members", MSG, "Ok", "");
} else return 0;
return 1;
}
stock GetClanMembers(clan[])
{
new clanquery[200];
new minfo[300], mreturn[300];
new string[300];
format(clanquery, sizeof(clanquery), "SELECT * FROM members WHERE clanname = '%s'", clan);
mysql_query(1,clanquery);
mysql_store_result();
while(mysql_fetch_row_format(clanquery,"|"))
{
mysql_fetch_field_row(string,"playername");
format(minfo,sizeof(minfo),"{FFFF00}%s\n",string);
strcat(mreturn, minfo);
}
mysql_free_result();
return mreturn;
}