public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
SendClientMessage(i, 0xF0F0FFF, "Wrong Password. Good Bye!");
Ban(i);
}
}
return 1;
}
new LoginAttempt[MAX_PLAYERS] = 0;
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
LoginAttempt[i]++;
if(LoginAttempt[i] > 2)
{
SendClientMessage(i, 0xF0F0FFF, "Wrong Password. Good Bye!");
Ban(i);
}
}
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pip[32];
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
GetPlayerIp(i, pip, sizeof(pip));
if(strcmp(pip, ip) == 0)
{
AddPVarInt(i, "FailedLogins", 1);
if(GetPVarInt(i, "FailedLogins") == 3)
{
SendClientMessage(i, 0xF0F0FFF, "Wrong Password. Good Bye!");
Ban(i);
}
}
}
}
}
return 1;
}
stock AddPVarInt(playerid, varname[], int_value)
{
SetPVarInt(playerid, varname, GetPVarInt(playerid, varname) + int_value);
}
new LoginAttempt[MAX_PLAYERS] = 0;
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new pip[16];
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, pip, sizeof(pip));
if(strcmp(pip, ip) == 0)
{
LoginAttempt[i]++;
if(LoginAttempt[i] > 2)
{
SendClientMessage(i, COLOR_RED, "Wrong Password. Good Bye!");
Ban(i);
}
}
}
}
return 1;
}
new RCONAttempts[MAX_PLAYERS];
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
new pIP[16]; GetPlayerIP(playerid, pIP, 16);
if(!strcmp(ip, pIP))
{
RCONAttempts[i]++;
if(RCONAttempts[i]>=3)
{
SendClientMessage(i, 0xF0F0FFF, "Wrong Password. Good Bye!");
Ban(i);
RCONAttempts[i]=0;
}
}
}
}
}
return 1;
}
RCONAttempts[playerid]=0;
Sorry, but I guess this one is the best way:
At TOP: pawn Код:
pawn Код:
pawn Код:
You need to reset the tries when the ID connects. ![]() Tell me if there is any bug. Jeffry ![]() |
Not completely. You don't have the thing at OnPlayerConnect, and the IsPlayerConnected at the loop is missing. ^^
But your one looks quite okey as well. ![]() |