SA-MP Forums Archive
loading groups problem.. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: loading groups problem.. (/showthread.php?tid=192858)



loading groups problem.. - The_Gangstas - 24.11.2010

pawn Код:
stock LoadGroup(id)
{
    new data[70];
    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];
        while(mysql_fetch_row(line))
        {
            new Gstr[9][70],Gvar[1];
            sscanf(line, "p<|>ds[70]s[70]s[70]s[70]s[70]s[70]s[70]s[70]s[70]",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]), 70);
            strmid(Groups[id][RankName0], Gstr[1], false, strlen(Groups[id][RankName0]), 70);
            strmid(Groups[id][RankName1], Gstr[2], false, strlen(Groups[id][RankName1]), 70);
            strmid(Groups[id][RankName2], Gstr[3], false, strlen(Groups[id][RankName2]), 70);
            strmid(Groups[id][RankName3], Gstr[4], false, strlen(Groups[id][RankName3]), 70);
            strmid(Groups[id][RankName4], Gstr[5], false, strlen(Groups[id][RankName4]), 70);
            strmid(Groups[id][RankName5], Gstr[6], false, strlen(Groups[id][RankName5]), 70);
            strmid(Groups[id][RankName6], Gstr[7], false, strlen(Groups[id][RankName6]), 70);
            strmid(Groups[id][MOTD], Gstr[8], false, strlen(Groups[id][MOTD]), 70);
            GroupCount++;
            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_fetch_field("Groupid",data);
        Groups[id][Groupid]=strval(data);
        mysql_fetch_field("GroupName",data);
        strmid(Groups[id][GroupName], data, false, strlen(Groups[id][GroupName]), 70);
        mysql_fetch_field("RankName0",data);
        strmid(Groups[id][RankName0], data, false, strlen(Groups[id][RankName0]), 70);
        mysql_fetch_field("RankName1",data);
        strmid(Groups[id][RankName1], data, false, strlen(Groups[id][RankName1]), 70);
        mysql_fetch_field("RankName2",data);
        strmid(Groups[id][RankName2], data, false, strlen(Groups[id][RankName2]), 70);
        mysql_fetch_field("RankName3",data);
        strmid(Groups[id][RankName3], data, false, strlen(Groups[id][RankName3]), 70);
        mysql_fetch_field("RankName4",data);
        strmid(Groups[id][RankName4], data, false, strlen(Groups[id][RankName4]), 70);
        mysql_fetch_field("RankName5",data);
        strmid(Groups[id][RankName5], data, false, strlen(Groups[id][RankName5]), 70);
        mysql_fetch_field("RankName6",data);
        strmid(Groups[id][RankName6], data, false, strlen(Groups[id][RankName6]), 70);
        mysql_fetch_field("MOTD",data);
        strmid(Groups[id][MOTD], data, false, strlen(Groups[id][MOTD]), 70);
        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;
}
prints
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:
with the both ways-.-


Re: loading groups problem.. - [L3th4l] - 24.11.2010

If you are using G-Stylezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz's plugin, post the logs here.


Re: loading groups problem.. - The_Gangstas - 24.11.2010

owow, i forgot logs anyways stricken kid's all the way

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".



Re: loading groups problem.. - The_Gangstas - 24.11.2010

bump../(8char)


Re: loading groups problem.. - The_Gangstas - 24.11.2010

hump..........