25.11.2010, 00:32
(
Последний раз редактировалось The_Gangstas; 25.11.2010 в 01:52.
)
pawn Код:
stock LoadGroup(id)
{
new data[256];
format(GlobalQuery1, sizeof(GlobalQuery1), "SELECT * FROM Groups WHERE Groupid = %d LIMIT 1",id);
mysql_query(GlobalQuery1);
mysql_store_result();
if(mysql_num_rows() > 0)
{
new line[700];
if(mysql_fetch_row(line,"|"))
{
new Gstr[9][70],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]);
Groups[id][Groupid] = Gvar[0];
strmid(Groups[id][GroupName], Gstr[0], false, strlen(Groups[id][GroupName]), 255);
strmid(Groups[id][RankName0], Gstr[1], false, strlen(Groups[id][RankName0]), 255);
strmid(Groups[id][RankName1], Gstr[2], false, strlen(Groups[id][RankName1]), 255);
strmid(Groups[id][RankName2], Gstr[3], false, strlen(Groups[id][RankName2]), 255);
strmid(Groups[id][RankName3], Gstr[4], false, strlen(Groups[id][RankName3]), 255);
strmid(Groups[id][RankName4], Gstr[5], false, strlen(Groups[id][RankName4]), 255);
strmid(Groups[id][RankName5], Gstr[6], false, strlen(Groups[id][RankName5]), 255);
strmid(Groups[id][RankName6], Gstr[7], false, strlen(Groups[id][RankName6]), 255);
strmid(Groups[id][MOTD], Gstr[8], false, strlen(Groups[id][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[id][Groupid],Groups[id][GroupName],Groups[id][RankName0],Groups[id][RankName1],Groups[id][RankName2],
Groups[id][RankName3],Groups[id][RankName4],Groups[id][RankName5],Groups[id][RankName6],Groups[id][MOTD]);
}
GroupCount++;
mysql_fetch_field("Groupid",data);
Groups[id][Groupid]=strval(data);
mysql_fetch_field("GroupName",data);
strmid(Groups[id][GroupName], data, false, strlen(Groups[id][GroupName]), 255);
mysql_fetch_field("RankName0",data);
strmid(Groups[id][RankName0], data, false, strlen(Groups[id][RankName0]), 255);
mysql_fetch_field("RankName1",data);
strmid(Groups[id][RankName1], data, false, strlen(Groups[id][RankName1]), 255);
mysql_fetch_field("RankName2",data);
strmid(Groups[id][RankName2], data, false, strlen(Groups[id][RankName2]), 255);
mysql_fetch_field("RankName3",data);
strmid(Groups[id][RankName3], data, false, strlen(Groups[id][RankName3]), 255);
mysql_fetch_field("RankName4",data);
strmid(Groups[id][RankName4], data, false, strlen(Groups[id][RankName4]), 255);
mysql_fetch_field("RankName5",data);
strmid(Groups[id][RankName5], data, false, strlen(Groups[id][RankName5]), 255);
mysql_fetch_field("RankName6",data);
strmid(Groups[id][RankName6], data, false, strlen(Groups[id][RankName6]), 255);
mysql_fetch_field("MOTD",data);
strmid(Groups[id][MOTD], data, false, strlen(Groups[id][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[id][Groupid],Groups[id][GroupName],Groups[id][RankName0],Groups[id][RankName1],Groups[id][RankName2],
Groups[id][RankName3],Groups[id][RankName4],Groups[id][RankName5],Groups[id][RankName6],Groups[id][MOTD]);
}
mysql_free_result();
return 1;
}
pawn Код:
[17:25:30] Loaded Groupid:1
[17:25:30] Groupid:1 Name: Rank0: Rank1: Rank2: Rank3: Rank4: Rank5: Rank6: MOTD:
[17:25:30] Loaded Groupid:1
[17:25:30] Groupid:1 Name: Rank0: Rank1: Rank2: Rank3: Rank4: Rank5: Rank6: MOTD:
pawn Код:
[Tue Nov 23 17:25:30 2010] Function: mysql_query executed: "SELECT * FROM Groups WHERE Groupid = 1 LIMIT 1" with result: "0".
[Tue Nov 23 17:25:30 2010] Function: mysql_store_result executed with result: "1"
[Tue Nov 23 17:25:30 2010] Function: mysql_num_rows executed with result: "%".
[Tue Nov 23 17:25:30 2010] Function: mysql_fetch_row executed with result: "1|Timeless|Newbie|Big Newbie|Hawt Newbie|Sexy Newbie|Pro|Expert Wanker|Leader|Welcome Back Timeless Killers".