08.11.2011, 13:13
Try:
Delete the on player connect pVisits, put it under when player logs in.
pawn Код:
if (dialogid == 200)
{
new name[MAX_PLAYER_NAME], file[256];
GetPlayerName(playerid, name, sizeof(name));
format(file, sizeof(file), SERVER_USER_FILE, name);
if(!response) return Kick(playerid);
if (!strlen(inputtext)) return ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Test", "Welcome back to server!", "Login", "Leave");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp) {
SendClientMessage(playerid, -1, ""COL_RED"[Error] "COL_WHITE"Wrong password!");
ShowPlayerDialog(playerid, 2, DIALOG_STYLE_INPUT, "Test", "Welcome back to server!", "Login", "Leave");
}
else
{
gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pKills] = dini_Int(file, "Kills");
PlayerInfo[playerid][pDeaths] = dini_Int(file, "Deaths");
PlayerInfo[playerid][pVisits] = dini_Int(file, "Visits");
SendClientMessage(playerid, -1, ""COL_ORANGE"Successfully logged in!");
PlayerInfo[playerid][pVisits]++;//move visits to player login
}
}