Code - Stopping rest of OnGameModeInit() from loading
#1

I've got no idea whats wrong. The SQL tables aren't null, and this code used to work. Any ideas?

pawn Код:
printf("Loading Ranks...");

    mysql_query("SELECT * FROM `ranks`");
    mysql_store_result();

    while(mysql_fetch_row(resultline)==1)
    {
        printf("%s", resultline);

        new id, rid, rname[24];

        if(!sscanf(resultline, "p<|>dds[23]", id, rid, rname))
        {
            RankInfo[id][rid][rFactionID] = id;
            RankInfo[id][rid][rRankID] = rid;
            strmid(RankInfo[id][rid][rName], rname, 0, strlen(rname), 255);
        }
        else
        {
            print("Error: There was a problem parsing rank data! Moving to next result.");
        }
    }
    mysql_free_result();
Reply
#2

I think you are breaking the array limits.

You set:
pawn Код:
new rname[24];
Then you use a destination size on the strmid line to: 255

Try setting, 255 to :
pawn Код:
sizeof(rname));
Reply
#3

Thanks for the input, but I know that's not the problem, as I've done that in other places, too.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)