24.08.2011, 10:48
pawn Code:
if(dialogid == 2)
{
if(!response) return Kick(playerid);
format(Query, sizeof(Query), "SELECT `NAME` FROM `USERS` WHERE `NAME` = '%s' AND `PASSWORD` = '%s'", pName, inputtext);
Result = db_query(Database, Query);
if(!db_num_rows(Result))
{
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Account", "Login to your account\nWrong password\n\nEnter your password:", "Login", "Quit");
}
else
{
new Field[30];
db_get_field_assoc(Result, "ADMINLEVEL", Field, 30);
PlayerInfo[playerid][pAdminLevel] = strval(Field);
PlayerInfo[playerid][pLogged] = 1;
SendClientMessage(playerid, Green, "You have logged in");
db_free_result(Result);
}
}
But it is not setting my adminlevel to whatever it retrieves from there.
I did this to find out but it just displayed 0
pawn Code:
COMMAND:test(playerid, params[])
{
new string[128];
format(string, sizeof(string), "Your admin level is: %d", PlayerInfo[playerid][pAdminLevel]);
SendClientMessage(playerid, -1, string);
return 1;
}