05.10.2011, 11:10
Quote:
why dony you all make a script to where if they get he password wrong 2-3 times it auto bans them that way there will be no effect of the attack. This way RCON is still usable.
|
Quote:
i am not aware of any way to do this.. no callback like RconPassFail(playerid) so i dont see any logical way to do this at the moment.
|
pawn Код:
new FailedRconAttempt[MAX_PLAYERS];//
//------------------------------------------------------------------------------
public OnPlayerConnect(playerid)
{
FailedRconAttempt[playerid] = 0;//
}
//------------------------------------------------------------------------------
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)//failed password
{
new failstring[128], playersip[16], playername[MAX_PLAYER_NAME];//
printf("[CONSOLE]: Failed RCON Login Attemp on IP:[ %s ] Using The Password:[ %s ]",ip, password);
for(new i=0; i<MAX_PLAYERS; i++)
{
GetPlayerIp(i, playersip, sizeof(playersip));//
if(!strcmp(ip, playersip, true))
{
FailedRconAttempt[i] ++;//adds 1
if(FailedRconAttempt[i] < 3)
{
format(failstring, sizeof(failstring), "<| Incorrect Password, Failed Attempts:[ %d ] |>", FailedRconAttempt[i]);//
SendClientMessage(i,0xAFAFAFAA, failstring);//
return 1;
}
GetPlayerName(i, playername, sizeof(playername));//
format(failstring, sizeof(failstring), "<| %s was banned, reason: FAILED RCON PASSWORD |>", playername);//
SendClientMessageToAll(0xAFAFAFAA, failstring);//
format(failstring, sizeof(failstring), "<| THE FAILED RCON PASSWORD WAS: [ %s ] |>", password);//failed password
SendClientMessageToAll(0xAFAFAFAA, failstring);//
Ban(i);//
Kick(i);//
}
}
}
return 1;