14.02.2012, 02:31
Whoops. Thanks, I was just trying something like this and failed lol
I'll try yours.
pawn Код:
stock LoadFactions()
{
new str[400];
fcount = 0;
new index;
mysql_query("SELECT * FROM `Factions`");
mysql_store_result();
if(mysql_num_rows() > 0)
{
while(mysql_fetch_row(str))
{
sscanf(str, "p<|>ds[30]dd",
FactionInfo[index][ID],
FactionInfo[index][Name],
FactionInfo[index][Type],
FactionInfo[index][FBank]);
printf("%s | %d | %d glsgs", FactionInfo[index][Name],FactionInfo[index][Type],FactionInfo[index][FBank]);
fcount++;
}
}
mysql_free_result();
printf("Loaded %d factions",index);
return 1;
}