Dialog not showing correctly
#1

Hey,

I've just started to implement a dialog, to load in all of the members within a faction (online and off), however when a member of the faction types in the cmd , it doesn't show for them, but shows for player id 0, I think it may be becasue its in a threaded query function? This is because I'm using BlueG's MySQL Plugin.

If anyone has a much simpler way to do this, it'd be greatly appreciated!, the information from the db all loads and formats correctly, it's just displaying the dialog with such information.

Код:
CMD:members(playerid)
{
	new query[1024],org;
	org=PlayerInfo[playerid][OrgID];
	mysql_format(ServerMySQL, query, sizeof(query), "SELECT * FROM Users WHERE OrgID=%d ORDER BY OrgTier DESC",org);
	mysql_tquery(ServerMySQL, query, "GetMembers", "",playerid);
	return 1;
}
forward GetMembers(playerid);
public GetMembers(playerid)
{
	new rows,fields,name[40],rank[30],memberstring[500],porg,titlestring[50];
    cache_get_data(rows,fields);
	for(new i = 0; i < rows; i++)
    {
		 cache_get_field_content(i, "Name", name, .max_len =40 );
		 cache_get_field_content(i, "OrgRank", rank, .max_len =30 );
		 porg=cache_get_field_content_int(i,"OrgID");
		 format(memberstring, sizeof(memberstring), "%s %d.%s [%s] \n",memberstring,i+1,name,rank);
	}
	format(titlestring,sizeof(titlestring),"%s Members List",oInfo[porg][Name]);
	ShowPlayerDialog(playerid,DIALOG_ORGMEMBERS,DIALOG_STYLE_LIST,titlestring,memberstring,"Select","Close");
	return 1;
}
Thanks for the support!

P.S I hate threads ha
Reply


Messages In This Thread
Dialog not showing correctly - by marley - 24.09.2016, 23:26
Re: Dialog not showing correctly - by Jefff - 25.09.2016, 00:47

Forum Jump:


Users browsing this thread: 1 Guest(s)