18.10.2017, 05:28
(
Последний раз редактировалось RedFall; 18.10.2017 в 15:29.
Причина: add Login Dialog code
)
new here
a player spawn after click login without any password
but i want not to spawn when password login dialog is empty or didn't match the encrypted password
a player spawn after click login without any password
but i want not to spawn when password login dialog is empty or didn't match the encrypted password
PHP код:
if(dialogid == DIALOG_LOGIN)
{
if(!response) return Kick(playerid);
{
new Hashed_Password[129];
WP_Hash(Hashed_Password, sizeof(Hashed_Password), inputtext);
//if(!strlen(inputtext)) return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");
//if(!strcmp(Hashed_Password, PlayerInfo[playerid][pPass]))
if(strcmp(Hashed_Password, PlayerInfo[playerid][pPass]))
{
INI_ParseFile(UserPath(playerid), "LoadUser_data", .bExtra = true, .extra = playerid);
SetPlayerScore(playerid,PlayerInfo[playerid][pScore]);
GivePlayerMoney(playerid,PlayerInfo[playerid][pCash]);
SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
SendClientMessage(playerid,sCOLOR_RED, SYSTEM_MSG ""cCOLOR_WHITE" Welcome back! You have successfully logged in");
ShowPlayerDialog(playerid, DIALOG_SUCCESS_LOGIN, DIALOG_STYLE_MSGBOX,""cCOLOR_WHITE"Success!",""cCOLOR_GREEN"You have successfully logged in!","Ok","");
TogglePlayerSpectating(playerid, true);
}
else
{
ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");
ShowPlayerDialog(playerid, DIALOG_FAILED_LOGIN, DIALOG_STYLE_MSGBOX,""cCOLOR_WHITE"Failed!",""cCOLOR_RED"Incorrent password!","Ok","");
return ShowPlayerDialog(playerid,DIALOG_LOGIN,DIALOG_STYLE_PASSWORD,"Login","Welcome back. This account is registered. \nInsert your password to login to your account.\nIncorrect password!","Login","Quit");
//return 1;
}
}
}