04.07.2015, 11:47
Can someone help me make a rcon protection system,so I want to make when a player enters the wrong rcon password,he gets auto ip baned.Execption for admins
public OnRconLoginAttempt(ip[], password[], success) { if(!success) //If the password was incorrect { printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password); new pip[16]; for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players { GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true) && !PlayerInfo[i][pAdmin]) //If a player's IP is the IP that failed the login AND they aren't an admin { SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message Ban(i); //They are now banned. } } } return 1; }
public OnRconLoginAttempt(ip[], password[], success)
{
if(!success)
{
new string[128];
format(string,sizeof(string),"banip %s",ip);
SendRconCommand(string);
}
return 1;
}
public OnRconLoginAttempt(ip[], password[], success) { if(!success) { printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password); new pip[16]; for(new i=0; i<MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) return 1; GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true)) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(i, name, sizeof(name)); format(str, sizeof(str), "{37DB45}%s {FF0000}was auto-banned by {0000FF}GOD{FF0000}. Reason: {DB881A}Attepmt to hack Rcon{FF0000}.", name); SendClientMessageToAll(0xFFFFFFFF,str); SendClientMessage(i, 0xFFFFFFFF, "You're banned."); Ban(i); } } } return 1; }
Код:
public OnRconLoginAttempt(ip[], password[], success) { if(!success) { printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password); new pip[16]; for(new i=0; i<MAX_PLAYERS; i++) { if(PlayerInfo[i][pAdmin] >= 1) return 1; GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true)) { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(i, name, sizeof(name)); format(str, sizeof(str), "{37DB45}%s {FF0000}was auto-banned by {0000FF}GOD{FF0000}. Reason: {DB881A}Attepmt to hack Rcon{FF0000}.", name); SendClientMessageToAll(0xFFFFFFFF,str); SendClientMessage(i, 0xFFFFFFFF, "You're banned."); Ban(i); } } } return 1; } |
public OnRconLoginAttempt(ip[], password[], success) { if(!success) //If the password was incorrect { printf("NEUSPIJELI POKUSAJ LOGIRANJA U RCON IP %s KORISTECI SIFRU %s",ip, password); new pip[16]; for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players { GetPlayerIp(i, pip, sizeof(pip)); if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login { new str[128], name[MAX_PLAYER_NAME]; GetPlayerName(i, name, sizeof(name)); format(str, sizeof(str), "{37DB45}%s {FF0000}je automatski banan {0000FF}GOD{FF0000}. Razlog: {DB881A}Pokusava provaliti u RCON{FF0000}.", name); SendClientMessageToAll(0xFFFFFFFF,str); SendClientMessage(i, 0xFFFFFFFF, "{FF0000}Kriva Lozinka. {0xFFFFFFFF}Automatski {FF0000}banan."); //Send a message SendClientMessage(i, 0xFFFFFFFF, "{DB881A}Za unban uslikajte ovo sa F8,i postavite na nasu fb grupu."); //Send a message Ban(i); //They are now banned. } } } return 1; }