31.03.2015, 13:54
pawn Code:
CMD:results(playerid,params[])
{
mysql_query("SELECT * FROM `table`");
mysql_store_resul();
if(mysql_num_rows())
{
new msg[512];
while(mysql_retrieve_row())
{
new tmp[24],name[24],Float:health,id;
mysql_fetch_field_row(name,"name");
mysql_fetch_field_row(tmp,"health"); health = floatstr(tmp);
mysql_fetch_field_row(tmp,"id"); id = strval(tmp);
format(msg,sizeof(msg),"%s%s - %d - %02f\n",msg,name,id,health);
}
ShowPlayerDialog(playerid,0,DIALOG_STYLE_LIST,"SQL Results",msg,"Close","");
}
else ShowPlayerDialog(playerid,0,DIALOG_STYLE_MSGBOX,"SQL Results","No results found","Close","");
return 1;
}