Help...Loading Groups
#27

i think its working..

pawn Код:
Gvar0:1,Gstr0:,Gstr1:Probation,Gstr2:To be tested
i guess its just shitty old strmid..
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;
}
Reply


Messages In This Thread
Help...Loading Groups - by The_Gangstas - 25.11.2010, 19:40
Re: Help...Loading Groups - by Austin - 25.11.2010, 21:54
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 21:57
Re: Help...Loading Groups - by Austin - 25.11.2010, 21:59
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 22:03
Re: Help...Loading Groups - by Austin - 25.11.2010, 22:07
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 22:08
Re: Help...Loading Groups - by Austin - 25.11.2010, 22:12
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 22:34
Re: Help...Loading Groups - by Austin - 25.11.2010, 22:35
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 22:43
Re: Help...Loading Groups - by Austin - 25.11.2010, 22:51
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 23:07
Re: Help...Loading Groups - by Austin - 25.11.2010, 23:12
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 23:20
Re: Help...Loading Groups - by Austin - 25.11.2010, 23:27
Re: Help...Loading Groups - by The_Gangstas - 25.11.2010, 23:40
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:05
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 00:10
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:13
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 00:16
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:20
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 00:29
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:33
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 00:41
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:42
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 00:47
Re: Help...Loading Groups - by Austin - 26.11.2010, 00:56
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 01:22
Re: Help...Loading Groups - by Austin - 26.11.2010, 01:23
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 01:25
Re: Help...Loading Groups - by Austin - 26.11.2010, 01:27
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 01:27
Re: Help...Loading Groups - by Austin - 26.11.2010, 01:29
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 01:31
Re: Help...Loading Groups - by Austin - 26.11.2010, 01:41
Re: Help...Loading Groups - by The_Gangstas - 26.11.2010, 01:54

Forum Jump:


Users browsing this thread: 1 Guest(s)