Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 04.11.2015
pawn Код:
forward GetRecord(playerid);
public GetRecord(playerid)
{
new r_msg[256], dialogstring[256], Rows = cache_get_row_count( );
if(Rows < 1)return SendClientMessage(playerid, COLOUR_GREY, "No records found.");
for(new n = 0; n < Rows; n++)
{
cache_get_row(0, 0, r_msg);
sscanf(r_msg, "p<|>e<iiiis[24]iiii>", PlayerArrests[n]);
cache_get_field_content(0, "Crime", PlayerArrests[n][ar_cr]);
if(n == 0)
{
format(dialogstring, sizeof(dialogstring), ""#COL_WHITE"%s", PlayerArrests[n][ar_cr]);
}
else
{
format(dialogstring, sizeof(dialogstring), "%s\n"#COL_WHITE"%s", dialogstring, PlayerArrests[n][ar_cr]);
}
}
strcpy(Pdialogstring[playerid], dialogstring, 200);
ShowPlayerDialog(playerid, DIALOG_RECORDS, DIALOG_STYLE_LIST, "Showing 10 Latest Records.", dialogstring, "Select", "Back");
return 1;
}
Title says all. It won't display in the dialog when I search a player that has records.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 05.11.2015
BUMP
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 06.11.2015
BUMP.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Lordzy - 06.11.2015
You've to mention the size in cache_get_field_content when you're dealing with multi-dimensional arrays.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 06.11.2015
Size of the string?
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Lordzy - 06.11.2015
cache_get_field_content(0, "Crime", PlayerArrests[n][ar_cr]); - Size of ar_cr?
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
MartinSwag - 06.11.2015
Cache_get_row, shouldn't the 0 be n?
cache_get_row(n, 0, r_msg);
Cache_get_field_content should also be n instead of 0.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 07.11.2015
I'm not sure.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
PrO.GameR - 07.11.2015
cache_get_field_content(0, "Username", PlayerI[playerid][Name], mysql, MAX_PLAYER_NAME);
Here is an example of how you should use mysql get field content when having strings in enums ^^^
last one (MAX_PLAYER_NAME) is the size, you should get ar_cr's size and put it there.
Re: Threaded MYSQL query, won't display in dialog, assistance would be appreciated. -
Dokins - 10.11.2015
Thank you!