Loading variables
#1

Nothing is loading, it all matches perfectly in the SQL.. I can't figure it out.

pawn Код:
stock LoadAccount(playerid)
{
    new Name[24],
        string[259];

    GetPlayerName(playerid, Name, sizeof(Name));
    format(string, sizeof(string), "SELECT * FROM `accounts` WHERE `username` = '%s'", Name);
    mysql_query(string);
    mysql_store_result();

    if(mysql_num_rows() > 0)
    {
        mysql_fetch_row_format(string, "|");
        sscanf(string, "p<|>is[24]s[129]s[16]iiiiifffiiiiii", PlayerInfo[playerid]);
        printf(string);
    }
    return 1;
}
pawn Код:
enum pInfo
{
    pSQLid,
    pUsername[24],
    pPassword[129],
    pIP[16],
    pAge,
    pSex,
    pMoney,
    pBank,
    pSkin,
    Float:pPos_x,
    Float:pPos_y,
    Float:pPos_z,
    pTutorial,
    pLevel,
    pAdmin,
    pMuted,
    pFaction,
    pFactionRank
}
new PlayerInfo[MAX_PLAYERS][pInfo];
Reply
#2

pawn Код:
e<p<|>is[24]s[129]s[16]iiiiifffiiiiii>
Reply
#3

use mysql_fetch_field
i hade the same problem but i solved it with this!
Reply
#4

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
pawn Код:
e<p<|>is[24]s[129]s[16]iiiiifffiiiiii>
Uh..? What is this?

The screen starts flashing when I log in, I know that's the fix because I can only log-in with the correct password, but what the FUCK happened? LOL.

http://imageshack.us/photo/my-images/801/samp007kp.png
Reply
#5

Means something fucked up with the mysql
Reply
#6

Quote:
Originally Posted by PrawkC
Посмотреть сообщение
Means something fucked up with the mysql
The SQL has no problem whatsoever. It's how it's being loaded
Reply
#7

Read sscanf2 topic, "e<>" is used to load the enum.

As for that problem, it might either be, you don't have an "AddPlayerClass" or you are setting a player's location to the wrong coordinates.
Reply
#8

Quote:
Originally Posted by [L3th4l]
Посмотреть сообщение
Read sscanf2 topic, "e<>" is used to load the enum.

As for that problem, it might either be, you don't have an "AddPlayerClass" or you are setting a player's location to the wrong coordinates.
Thanks, I was directed there a few minutes ago by a friend. Also, after adding AddPlayerClass, and re-checking that everything WAS loading correctly, I still seem to be having the problem with the flashing.
Reply
#9

This problem was solved over MSN. Its a bug in sscanf having to do with incorrectly parsing float data (on linux servers). Anyone having this problem should revert back to this version:

http://www.sendspace.com/file/a3vjpy

It seems to be the latest stable version (Thanks to nemesis @ impulse99 for providing the file).
Reply
#10

Never mind.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)