25.11.2010, 22:43
pawn Код:
stock LoadGroups2()
{
printf("[System] Loading Groups's....");
new data[256];
for (new i=0; i<MAX_GROUPS; i++)
{
format(GlobalQuery, sizeof(GlobalQuery), "SELECT * FROM Groups ORDER BY Groupid");
mysql_query(GlobalQuery);
mysql_store_result();
if(mysql_num_rows() > 0)
{
new line[1024];
while(mysql_fetch_row(line)==1)
{
GroupCount++;
mysql_fetch_field_row(data,"Groupid");
Groups[i][Groupid]=strval(data);
mysql_fetch_field_row(data,"GroupName");
strmid(Groups[i][GroupName], data, false, strlen(Groups[i][GroupName]), 255);
mysql_fetch_field_row(data,"RankName0");
strmid(Groups[i][RankName0], data, false, strlen(Groups[i][RankName0]), 255);
mysql_fetch_field_row(data,"RankName1");
strmid(Groups[i][RankName1], data, false, strlen(Groups[i][RankName1]), 255);
mysql_fetch_field_row(data,"RankName2");
strmid(Groups[i][RankName2], data, false, strlen(Groups[i][RankName2]), 255);
mysql_fetch_field_row(data,"RankName3");
strmid(Groups[i][RankName3], data, false, strlen(Groups[i][RankName3]), 255);
mysql_fetch_field_row(data,"RankName4");
strmid(Groups[i][RankName4], data, false, strlen(Groups[i][RankName4]), 255);
mysql_fetch_field_row(data,"RankName5");
strmid(Groups[i][RankName5], data, false, strlen(Groups[i][RankName5]), 255);
mysql_fetch_field_row(data,"RankName6");
strmid(Groups[i][RankName6], data, false, strlen(Groups[i][RankName6]), 255);
mysql_fetch_field_row(data,"MOTD);
strmid(Groups[i][MOTD], data, false, strlen(Groups[i][MOTD]), 255);
printf("Loaded Groupid:%d",id);
printf("Groupid:%d Name:%s Rank0:%s Rank1:%s Rank2:%s Rank3:%s Rank4:%s Rank5:%s Rank6:%s MOTD:%s",
Groups[i][Groupid],Groups[i][GroupName],Groups[i][RankName0],Groups[i][RankName1],Groups[i][RankName2],
Groups[i][RankName3],Groups[i][RankName4],Groups[i][RankName5],Groups[i][RankName6],Groups[i][MOTD]);
}
}
}
printf("[System] A Total Of %d Groups Spawned!",GroupCount);
mysql_free_result();
return 1;
}