29.10.2011, 10:26
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;
}
But when he logs in, and I print the previous vars, it prints (null).
Whats wrong?
