31.07.2016, 07:06
Hello. I'm trying to make a command /factions which will show user all the factions in my database.
However, It doesn't seem to work for me.
Do I have to use callback for such thing isn't there a simpler way to achieve what I want.
However, It doesn't seem to work for me.
PHP код:
CMD:factions(playerid,params[])
{
mysql_tquery(mysql, "SELECT * FROM `Factions` LIMIT "#MAX_FACTIONS"", "LoadFactionsIG", "");
return 1;
}
forward LoadFactionsIG();
public LoadFactionsIG()
{
new userstring[250];
new count = cache_get_row_count();
for (new i; i < count; i++)
{
format(userstring, sizeof(userstring), "%s \n",cache_get_field_content(i, "Name", Factions[i][Name]));
ShowPlayerDialog(i, 10, DIALOG_STYLE_MSGBOX, "Factions", userstring, "OK","");
}
printf("> %d factions have been loaded from the database.", count); // Prints out the information of how many factions created
return 1;
}