22.12.2010, 20:34
Hello,
I would like then that when the player register there a new dialog for that he logged.
But the problem is that when the player register he is logged automatically.
But i maked a system, the problem is that when the player register, the dialog for logged appears not.
In OnPlayerConnect
In OnDialogResponse:
Thanks
Lowsou
(Sorry for my languages. I'am french)
I would like then that when the player register there a new dialog for that he logged.
But the problem is that when the player register he is logged automatically.
But i maked a system, the problem is that when the player register, the dialog for logged appears not.
In OnPlayerConnect
Code:
if(fexist(file))
{
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Welcome!","Your account has benn create!\nentry your password","Connect","Quit");
}
Code:
if (dialogid == 3)
{
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, 3, DIALOG_STYLE_INPUT,Welcome!","Your account has benn create!\nentry your password","Connect","Quit");
new tmp;
tmp = dini_Int(file, "Password");
if(udb_hash(inputtext) != tmp)
{
SendClientMessage(playerid, COLOR_RED, "Your password is wrong.");
ShowPlayerDialog(playerid, 3, DIALOG_STYLE_INPUT, "Welcome!","Your account has benn create!\nentry your password","Connect","Quit");
}
else
{
gPlayerLogged[playerid] = 1;
PlayerInfo[playerid][pAdminLevel] = dini_Int(file, "AdminLevel");
SetPlayerScore(playerid, PlayerInfo[playerid][pScore]);
GivePlayerMoney(playerid, dini_Int(file, "Money")-GetPlayerMoney(playerid));
SendClientMessage(playerid,COLOR_RED, "Your are logged");
}
}
Lowsou
(Sorry for my languages. I'am french)

