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);
}
}
Now that code compiles fine now, idk why it didn't do it before, but it seems like it compiled now.
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;
}
Why doesn't it put the value into PlayerInfo[playerid][pAdminLevel] ?