Ban! -
[MM]18240[FMB] - 20.07.2012
I want something so that if someone types /rcon login [Anything] They're banned. I need this because almost everyone who joins my server tries to login to RCON. I don't need it used IG because I run it VIA console. Anyone know something like this? I want it to say, "GotYourAss has banned [BANNEDNAME] for attempting to login to RCON!
Re: Ban! -
Chris1337 - 20.07.2012
just use
pawn Код:
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)) //If a player's IP is the IP that failed the login
{
SendClientMessage(i, 0xFFFFFFFF, "Wrong Password. Bye!"); //Send a message
Ban(i); //They are now banned.
}
}
}
return 1;
}
https://sampwiki.blast.hk/wiki/OnRconLoginAttempt
Re: Ban! -
L.Hudson - 20.07.2012
I want also to note that you can create a reason.
like changing
to
pawn Код:
BanEx(i, "Rcon Login Attempt");
Re: Ban! -
[MM]18240[FMB] - 20.07.2012
Thank you both, will this also ban someone if they get it right?
Nevermind, tested and works doesn't ban if the password is correct, REPPED YOU BOTH!
Re: Ban! -
[KHK]Khalid - 20.07.2012
axxelac's method won't ban them if they succeeded.
Re: Ban! -
jeremy8810 - 20.07.2012
Well if you dont use it ingame you can also just put it out if u want
Re: Ban! -
[MM]18240[FMB] - 20.07.2012
I want the ban broadcasted throughout the server aswell.
Re: Ban! -
newbienoob - 20.07.2012
SendClientMessageToAll
Re: Ban! -
[MM]18240[FMB] - 20.07.2012
Okay.
And it works fine, here is the log.
[22:05:33] [join] Kalgon has joined the server (0:184.88.128.151)
[22:05:48] GotYourAss has banned IP 184.88.128.151 for a bad RCON login attempt using the password TROLOLOLOL
[22:05:48] [part] Kalgon has left the server (0:2)
[22:05:48] RCON (In-Game): Player #0 (Kalgon) <TROLOLOLOL> failed login.
But I changed
pawn Код:
printf("GotYourAss has banned IP %s for a bad RCON login attempt using the password %s",ip, password);
to
pawn Код:
SendClientMessageToAll("GotYourAss has banned IP %s for a bad RCON login attempt using the password %s",ip, password);
and got the error.
pawn Код:
**.pwn(20) : error 035: argument type mismatch (argument 1)
EDIT3:NVM forgot a color HEX
Re: Ban! -
SuperViper - 20.07.2012
If you don't want to ban them, you can simply disable in-game RCON (console will still stay) by putting
in server.cfg.