I want Put in my login script 2 times warn then 3 time kicked from server if player put incorrect password.
Код:
case LOGIN_MENU:
{
new f[40], string[150];
format(f, sizeof(f), USER_FILE, GetName(playerid));
if(!strlen(inputtext)) return SendClientMessage(playerid, RED, "You MUST provide a password.") && Kick(playerid);
else if(!response) return SendClientMessage(playerid, RED, "You MUST login before you can spawn.") && Kick(playerid);
{
new buf[129];
WP_Hash(buf, sizeof (buf), inputtext);
if(strcmp(buf, PlayerInfo[playerid][pPass], false) != 0)
{
SendClientMessage(playerid, RED, "Incorrect password.");
format(string, sizeof(string), "%s [%d] has been kicked from NVCNR - Reason: Incorrect password", GetName(playerid), playerid);
SendClientMessage(playerid, RED, string);
Kick(playerid);
return 1;
}
use a simple variable.
pawn Код:
Warns[playerid] ++;
if(Warns[playerid] =< 3)return SendClientMessage(playerid, -1, "3 false attempts will get you kicked");
if(Warns[playerid] == 3)return Kick(playerid);