31.08.2017, 09:52
PHP код:
case DIALOG_LOGIN:
{
if(!response)
return KickDelay(playerid);
WP_Hash(hash, sizeof(hash), inputtext);
if(!strcmp(hash, Player[playerid][playerPassword], true))
{
new country[256];
GetPlayerCountry(playerid, country, sizeof(country));
format(message, 256, "{0066ff}* %s(%d) has connected to the server from %s.", GetName(playerid),playerid,country);
SendClientMessageToAll(COLOR_WHITE,message);
//ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Welcome back", message, "Submit", "");
Player[playerid][tryLogin] = 0;
Player[playerid][playerLogged] = GetTickCount();
Player[playerid][useCommand] = true;
Player[playerid][loggedIn] = true;
Player[playerid][savedHealth] = 0;
Player[playerid][cooldown] = SetTimerEx("CooldownTimer",180000, true, "d", playerid); //Wanted level reducing timer (5 mins)
Player[playerid][intresttimer] = SetTimerEx("InterestTimer",360000, true, "d", playerid); //Interest Timer (6 mins update) //3600000
initTextdraw(playerid);
}
else
{
Player[playerid][tryLogin]++;
if(Player[playerid][tryLogin] < 3)
{
new pesan[300];
//format(message, 256, CHAT_WHITE"Wrong password, \nPlease enter your password in the field below. (%d/3)", Player[playerid][tryLogin]);
//ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT, "Login", message, "Login", "Leave");
format(pesan, sizeof(pesan), "{ffffff}Welcome to Los Santos {0066ff}Cops {ffffff}and {ff0000}Robbers.\n\n{ffffff}User Name: {ff7a00}%s.\n{ffffff}Ip Address: {ff7a00}%s\n\n{ff0000}You have entered a wrong password (%d/3)\n{ffffff}Enter your password..", GetName(playerid),getIP(playerid),Player[playerid][tryLogin]);
ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "LSCNR - LOGIN", pesan, "Login", "Quit");
}
else
{
ShowPlayerDialog(playerid, DIALOG_UNUSED, DIALOG_STYLE_MSGBOX, "Wrong Password", "You have mistyped your password too often (3 times)", "Okay", "");
KickDelay(playerid);
}
}
}