18.07.2010, 05:08
hey how do i make it if login failed 3 times kick playerid
pawn Код:
if(dialogid == 1 || dialogid == 12347)
{
if(strlen(inputtext))
{
new ppw[20], str[128];
if(strlen(ppw) < 3) return SendMsg(playerid, RED, "*Error: Password Is Under The Limit Sorry");
if(strlen(ppw) > 20) return SendMsg(playerid, RED, "*Error: Password Is Over The Limit Sorry");
if(!dini_Exists(pfile)) return SendMsg(playerid, RED, "*Error: No account with that username is registered, please register");
format(pfile, sizeof(pfile), pfile_path, Playername(playerid));
if(strcmp(dini_Get(pfile, "Password"), ppw, true) == 1) return SendMsg(playerid, RED, "*Error: Wrong Password. Password Did Not Match With The One You Have Register With.");
format(str, sizeof(str), "*Success: You have Successfully Logged In %s", Playername(playerid), dini_Int(pfile, "AdminLevel"));
SendMsg(playerid, LIME, str);
LoadPlayer(playerid);
IsLogged[playerid] = 1;
SetTimerEx("TimePlayerLogged", 1000, true, "i", playerid);
}
else
{
new str[128];
format(str,sizeof(str),"Unsuccessfull: Wrong Password.");
SendMsg(playerid, RED, str);
IsLogged[playerid] = 0;
format(str,sizeof(str),"You Failed To Login Please Try Again\nPlease insert your password into the line below and click \"Login\" To Login. \n Click \"Cancel\" to cancel.",Playername(playerid));
ShowPlayerDialog(playerid,1,DIALOG_STYLE_INPUT,"Login",str,"Login","Cancel");
}
}