23.12.2015, 12:26
Hello im having an issue with loading a players account.
it saves everything perfectly to the DB but then when you leave and then join again all variables are set too 0
For example i set my selft as admin level 3, then leave it saves to the DB
i then log back into my account and my admin level is 0
it saves everything perfectly to the DB but then when you leave and then join again all variables are set too 0
Код:
public OnAccountLoad(playerid) { PlayerInfo[playerid][pAdminLevel] = cache_get_field_content_int(0, "AdminLevel"); TogglePlayerSpectating(playerid, false); SpawnPlayer(playerid); SendClientMessage(playerid, -1, "You have successfully logged in."); return 1; } public OnAccountCheck(playerid) { new rows, fields; cache_get_data(rows, fields, mysql); if(rows) { cache_get_field_content(0, "Password", PlayerInfo[playerid][Password], mysql, 129); ShowPlayerDialog(playerid, LoginDialog, DIALOG_STYLE_INPUT, "Login", "Welcome player!\nYour account has been found in our database. Please fill in your password:", "Login", "Quit"); } else { ShowPlayerDialog(playerid, RegisterDialog, DIALOG_STYLE_INPUT, "Register", "Welcome player!\nYour account has not been registered yet. Please fill in your desired password:", "Register", "Quit"); } return 1; }
i then log back into my account and my admin level is 0