Storing data into the variables...?
#1

Guys... I have this function, but the problem is that the data doesn't get stored into the variables and so nothing works correctly...

pawn Код:
stock LoadAccountVariables(playerid)
{
    new EscapedName[MAX_PLAYER_NAME];
    if(IsPlayerConnectedEx(playerid))
    {
        mysql_real_escape_string(GetName(playerid), EscapedName);
        format(Query, sizeof(Query), "SELECT * FROM `Accounts` WHERE `Username` = '%s'", EscapedName);
        mysql_query(Query);
        mysql_store_result();
       
        mysql_fetch_row_format(Query, "|");
        sscanf(Query, "e<p<|>s[24]s[146]ddddfffff>", PlayerStats[playerid]);

        SetPlayerHealth(playerid, PlayerStats[playerid][pHealth]);
        SetPlayerArmour(playerid, PlayerStats[playerid][pArmour]);
    }
    else print("[MySQL ERROR] LoadAccountVariables() was called, but to a non-connected ID.");
    mysql_free_result();
}
How do I store what sscanf extracts so I can use it throughout the script?
Reply


Messages In This Thread
Storing data into the variables...? - by Scenario - 06.11.2010, 16:58
Re: Storing data into the variables...? - by Miguel - 06.11.2010, 17:14
Re: Storing data into the variables...? - by Scenario - 06.11.2010, 17:18
Re: Storing data into the variables...? - by Miguel - 06.11.2010, 17:25
Re: Storing data into the variables...? - by Scenario - 06.11.2010, 17:37

Forum Jump:


Users browsing this thread: 1 Guest(s)