26.11.2010, 00:47
i think its working..
i guess its just shitty old strmid..
pawn Код:
Gvar0:1,Gstr0:,Gstr1:Probation,Gstr2:To be tested
pawn Код:
stock LoadGroups()
{
printf("[System] Loading Groups's....");
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];
if(mysql_fetch_row(line))
{
new Gstr[9][255],Gvar[1];
sscanf(line, "p<|>ds[255]s[255]s[255]s[255]s[255]s[255]s[255]s[255]s[255]",Gvar[0],Gstr[0],Gstr[1],Gstr[2],Gstr[3],Gstr[4],Gstr[5],Gstr[6],Gstr[7],Gstr[8]);
printf("Gvar0:%d,Gstr0:%s,Gstr1:%s,Gstr2:%s",Gvar[0],Gstr[0],Gstr[1],Gstr[2]);
Groups[i][Groupid] = Gvar[0];
strmid(Groups[i][GroupName], Gstr[0], false, 70);
strmid(Groups[i][RankName0], Gstr[1], false, 70);
strmid(Groups[i][RankName1], Gstr[2], false, 70);
strmid(Groups[i][RankName2], Gstr[3], false, 70);
strmid(Groups[i][RankName3], Gstr[4], false, 70);
strmid(Groups[i][RankName4], Gstr[5], false, 70);
strmid(Groups[i][RankName5], Gstr[6], false, 70);
strmid(Groups[i][RankName6], Gstr[7], false, 70);
strmid(Groups[i][MOTD], Gstr[8], false, 70);
GroupCount++;
printf("Loading Groupid:%d",GroupCount);
printf("Groupid:%d Name:%s Rank0:%s Rank1:%s Rank2:%s Rank3:%s Rank4:%s Rank5:%s Rank6:%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);
//if(GroupCount <= 0 || GroupCount > MAX_GROUPS)
//{
// GroupCount=0;
//}
mysql_free_result();
return 1;
}