SA-MP Forums Archive
Loading variables - 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 variables (/showthread.php?tid=276213)



Loading variables - Antonio [G-RP] - 12.08.2011

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];



Re: Loading variables - [L3th4l] - 12.08.2011

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



Re: Loading variables - Tigerkiller - 12.08.2011

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


Re: Loading variables - Antonio [G-RP] - 13.08.2011

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


Re: Loading variables - PrawkC - 13.08.2011

Means something fucked up with the mysql


Re: Loading variables - Antonio [G-RP] - 13.08.2011

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


Re: Loading variables - [L3th4l] - 13.08.2011

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.


Re: Loading variables - Antonio [G-RP] - 13.08.2011

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.


Re: Loading variables - Kyosaur - 13.08.2011

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


Re: Loading variables - Onyewu - 13.08.2011

Never mind.