Dialog just turns off and dosent log me in? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Dialog just turns off and dosent log me in? (
/showthread.php?tid=133470)
Dialog just turns off and dosent log me in? -
Torran - 12.03.2010
Hello,
I connect to my server, And i goto put my password in,
I put it in and press login, But the dialog just switches of,
And im stuck spectating, Although if i delete my file,
And register and THEN login it works fine?
If you want to see my login code then just ask
Re: Dialog just turns off and dosent log me in? -
¤Adas¤ - 12.03.2010
show it
Re: Dialog just turns off and dosent log me in? -
Torran - 12.03.2010
pawn Код:
if (dialogid == DIALOG_TYPE_LOGIN)
{
if (response) {
new PlayerName[24];
if(strlen(inputtext) == 0) return ShowPlayerDialog(playerid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_INPUT, "Account", "Error ~ Please enter a password \n\nWelcome to tRoleplay \nAs your account is registered please login to it \nYou will not be able to play this server until you login \n\nHint: To login enter the password used to register below and hit the button Login", "Login", "Cancel");
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
format(file,sizeof(file),"/tRoleplay/%s.ini",name);
if(fexist(file)) {
new password = dini_Int(file, "Password");
if(udb_hash(inputtext) != password) {
ShowPlayerDialog(playerid, DIALOG_TYPE_LOGIN, DIALOG_STYLE_INPUT, "Account", "Error ~ Incorrect password \n\nWelcome to tRoleplay \nAs your account is registered please login to it \nYou will not be able to play this server until you login \n\nHint: To login enter the password used to register below and hit the button Login", "Login", "Cancel");
GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
printf("%s has failed to login", name);
}
else {
TogglePlayerSpectating(playerid, 0);
IsLogged[playerid] = 1;
PlayerInfo[playerid][AdminLevel] = dini_Int(file, "AdminLevel");
PlayerInfo[playerid][Finalize] = dini_Int(file, "Finalize");
PlayerInfo[playerid][Gender] = dini_Int(file, "Gender");
PlayerInfo[playerid][City] = dini_Int(file, "City");
SendClientMessage(playerid, COLOR_GREEN, "You have successfully logged into your account");
}
}
}
if (!response) Kick(playerid);
}