Dialog not showing correctly - 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: Dialog not showing correctly (
/showthread.php?tid=617676)
Dialog not showing correctly -
marley - 24.09.2016
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
Re: Dialog not showing correctly -
Jefff - 25.09.2016
Replace "" to "i" after "GetMembers"