31.01.2014, 06:24
Hello, i'm wanting to get all members of a club into a dialog and i got this code:
But this doesnt give any names. Just weird thingys. Does anyone know how to actually get the names?
pawn Код:
Dialog_ClubOwner(playerid, response, listitem)
{
if(!response) return 1;
switch(listitem)
{
case 0:
{
new string[256];
for(new i = 0; i < MAX_CLUBS; i++)
{
if(IsPlayerInRangeOfPoint(playerid, 2.5, AClubData[i][ClubX], AClubData[i][ClubY], AClubData[i][ClubZ]))
{
format(string, sizeof(string), "SELECT Name FROM Users WHERE Club = '%s'", AClubData[i][ClubName]);
mysql_function_query(Handle, string, true, "ClubMemberList", "i", playerid);
}
}
}
}
return 1;
}
forward ClubMemberList(playerid);
public ClubMemberList(playerid)
{
new rows, fields, string[1000];
cache_get_data(rows, fields, Handle);
for(new i; i < Max_ClubMembers; i++)
{
format(string, sizeof(string), "%s%s\n", string, fields);
}
ShowPlayerDialog(playerid, DialogClubMembers, DIALOG_STYLE_LIST, "Club members", string, "Ok", "Cancel");
return 1;
}