06.11.2010, 02:22
pawn Код:
public LoadGangs()
{
new Gangstr[2][26];
new Gangvar[2];
new line[512];
printf("Loading Gang's....");
format(GlobalQuery, sizeof(GlobalQuery), "SELECT Gangid, Leader, Name, Members FROM Gangs");
mysql_query(GlobalQuery);
mysql_store_result();
new gangid;
if(mysql_fetch_row(line))
{
sscanf(line, "p<|>ds[64]s[64]d",Gangvar[0],Gangstr[0],Gangstr[0],Gangvar[1]);
gangid = Gangvar[0];
if(gangid >= MAX_GANGS){printf("Max gang's Reached.");return 1;}
GangInfo[gangid][gGangid] = gangid;
strmid(GangInfo[gangid][gLeader], Gangstr[0], false, strlen(Gangstr[0]), 24);
strmid(GangInfo[gangid][gName], Gangstr[1], false, strlen(Gangstr[1]), 26);
GangInfo[gangid][gMembers] = Gangvar[1];
}
return 1;
}