if(strcmp(action,"chat",true) == 0)
{
new stringg[256];
new aim[2000];
mysql_format(handle, stringg, sizeof(stringg), "SELECT * FROM `chatlogs` WHERE ID = %d", playerVariables[id][pID]);
new test[256], test2[256];
new Cache: result12 = mysql_query (handle, stringg);
new i = cache_get_row_count();
if(i > 10)
{
for(i = cache_get_row_count(); i > cache_get_row_count()-10; i--)
{
cache_get_field_content(i, "text", test);
cache_get_field_content(i, "time", test2);
format(aim,sizeof(aim),"%s[%s] %s\n",aim, test2, test);
ShowPlayerDialog(playerid, 256, DIALOG_STYLE_MSGBOX, "chat for player", aim, "Close", "");
}
}
else
{
for(i = cache_get_row_count(); i > 1; i--)
{
cache_get_field_content(i, "text", test);
cache_get_field_content(i, "time", test2);
format(aim,sizeof(aim),"%s[%s] %s\n",aim, test2, test);
ShowPlayerDialog(playerid, 256, DIALOG_STYLE_MSGBOX, "chat for player", aim, "Close", "");
}
}
cache_delete(result12);
}
Asa arata.