14.02.2012, 01:35
pawn Код:
stock LoadFactions()
{
new Query[400];
fcount = 0;
for(new id = 0;id<MAX_FACTIONS;id++)
{
format(Query, sizeof(Query), "SELECT * FROM Factions WHERE ID = %d", id);
mysql_query(Query);
mysql_store_result();
fcount++;
if(mysql_num_rows() != 0)
{
if(mysql_fetch_row_format(Query, "|"))
{
sscanf(Query, "p<|>s[30]dd",
FactionInfo[id][Name],
FactionInfo[id][Type],
FactionInfo[id][FBank]);
printf("%s | %d | %d", FactionInfo[id][Name],FactionInfo[id][Type],FactionInfo[id][FBank]);
}
}
}
printf("%i Faction Loaded",fcount);
return 1;
}
I have this code, and i want it to count each faction it has found on the database. For starters, the printf(%s | etc doesn't show up in the console, at all, so I'm guess it doesnt load up at all. How could I fix this issue, and also count each faction found? Thanks in advance.