SA-MP Forums Archive
Airlines wont load correctly - 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)
+--- Thread: Airlines wont load correctly (/showthread.php?tid=333458)



Airlines wont load correctly - Luis- - 11.04.2012

Hi, i've got a airline loading system which is completely the same as my other loading systems;
pawn Код:
enum aInfo
{
    aID,
    Float:aX,
    Float:aY,
    Float:aZ,
    aSkin,
    aRank1[50],
    aRank2[50],
    aRank3[50],
    aRank4[50],
    aRank5[50],
    aName[100],
    aFunds,
    aMOTD[128],
}
new AirlineInfo[MAX_AIRLINES][aInfo];
new airlines;

stock LoadAirlines()
{
    mysql_query("SELECT * FROM `airlines`");
    mysql_store_result();
    new line[550];
    while(mysql_fetch_row_format(line)) {
        sscanf(line, "e<p<|>dfffds[50]s[50]s[50]s[50]s[50]s[100]ds[128]>", AirlineInfo[airlines]);
        ++airlines;
        print(line);
    }
    printf("Loaded Airlines: %d.", airlines);
    mysql_free_result();
    return 1;
}
I honestly have no idea. It's loading correctly, it's just not assigning the vars, as you can see i've set a little debug print, here it is;
Код:
[01:08:20] Airlines ID: 0
[01:08:20] 1|9.9|0|0|120|rank1|rank2|rank3|rank4|rank5|nametest|0|Default
[01:08:20] Airlines ID: 0
[01:08:20] 2|0|0|0|113|Test1|Test2|rank3|test4|rank5|Luis_Test|0|
[01:08:20] Loaded Airlines: 2.



Re: Airlines wont load correctly - Luis- - 11.04.2012

bump.


Re: Airlines wont load correctly - [LoF]Zak - 11.04.2012

Do you have the latest sscanf?

which you need to #include <sscanf2>


Re: Airlines wont load correctly - Luis- - 11.04.2012

Yes. I already have it.


Re: Airlines wont load correctly - Kar - 11.04.2012

don't use enums..try using it without enum.. also try without sscanf (mysql_get_field) (the speed is not a factor) Please don't rep me if this helped btw