SQLite help
#1

pawn Код:
function LoginPlayer(playerid)
{
    new DBResult: Result;
    format(Query, sizeof(Query),"SELECT * FROM `Users` WHERE `Username` = '%s'", GetPName(playerid));
    Result = db_query(Users,Query);
    new Field[30];

    db_get_field_assoc(Result, "Money", Field, 30);
    PInfo[playerid][Money] = strval(Field);

    db_get_field_assoc(Result, "Jailed", Field, 30);
    PInfo[playerid][Jailed] = strval(Field);

    db_get_field_assoc(Result, "Jailtime", Field, 30);
    PInfo[playerid][Jailtime] = strval(Field);
   
    GivePlayerMoney(playerid,PInfo[playerid][Money]);
    PInfo[playerid][Logged] = 1;
   
    db_free_result(Result);
    return 1;
}
When the player disconnects from the server, it saves the stats. (I printed it)
But when he logs in, and I print the previous vars, it prints (null).
Whats wrong?
Reply


Messages In This Thread
SQLite help - by FireCat - 29.10.2011, 10:26
Re: SQLite help - by DRIFT_HUNTER - 29.10.2011, 10:51
Re: SQLite help - by ahbir_jhon - 29.10.2011, 10:53
Re: SQLite help - by Zh3r0 - 29.10.2011, 11:03
Re: SQLite help - by FireCat - 29.10.2011, 11:04

Forum Jump:


Users browsing this thread: 2 Guest(s)