Posts: 1,648
Threads: 482
Joined: Jun 2010
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.
Posts: 1,648
Threads: 482
Joined: Jun 2010
Posts: 1,648
Threads: 482
Joined: Jun 2010
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
You've to mention the size in cache_get_field_content when you're dealing with multi-dimensional arrays.
Posts: 1,648
Threads: 482
Joined: Jun 2010
Posts: 2,698
Threads: 37
Joined: Mar 2012
Reputation:
0
cache_get_field_content(0, "Crime", PlayerArrests[n][ar_cr]); - Size of ar_cr?
Posts: 40
Threads: 4
Joined: Aug 2015
Reputation:
0
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.
Posts: 1,648
Threads: 482
Joined: Jun 2010
Posts: 694
Threads: 2
Joined: Oct 2012
Reputation:
0
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.
Posts: 1,648
Threads: 482
Joined: Jun 2010