mysql_format(SQL, query, "SELECT * FROM `users` WHERE `Admin` != 0");
mysql_tquery(SQL, query, "ShowAdmins", "d", playerid); // sa zicem ca am bagat acest query intr-o comanda, playerid = jucatorul care a folosit comanda
.
.
.
forward ShowAdmins(playerid);
public ShowAdmins(playerid)
{
for(new i, j = cache_get_row_count(); i != j; i++)
{
new name[MAX_PLAYER_NAME];
cache_get_field_content(i, "Name", name);
SendClientMessage(playerid, -1, name);
}
return 1;
}
Daca chiar vrei optimizare, in loc s a selectezi N coloane ep care o ricum nu le folosesti mai bine le selectezi pe cele folosite
mysql_format(SQL, query, "SELECT Name FROM `users` WHERE `Admin` != 0");
mysql_tquery(SQL, query, "ShowAdmins", "d", playerid); // sa zicem ca am bagat acest query intr-o comanda, playerid = jucatorul care a folosit comanda
.
.
.
forward ShowAdmins(playerid);
public ShowAdmins(playerid)
{
for(new i, j = cache_get_row_count(); i != j; i++)
{
new name[MAX_PLAYER_NAME];
cache_get_field_content(i, "Name", name);
SendClientMessage(playerid, -1, name);
}
return 1;
}
Adica de ce sa lasi serverul sa faca munca suplimentara
La cum am vazut eu gm de rpg tabelul users/players are sute de coloane care e o oarecare anomalie