13.04.2018, 20:23
Introduction
I am making this tutorial for those people who are getting attacked by rcon crackers.
So lets start....I am making this tutorial for those people who are getting attacked by rcon crackers.
Code:
public OnRconLoginAttempt(ip[], password[], success) { if(success) {
if he try to cancel = kicked
if he try to enter wrong password = kicked.
full security.
Code:
new pip[16], playername[25], string[270];
Code:
for(new i=0; i<MAX_PLAYERS; i++) { if(IsPlayerConnected(i)) {
Code:
GetPlayerName(i, playername, MAX_PLAYER_NAME); GetPlayerIp(i, pip, sizeof(pip));
Code:
if(!strcmp(ip, pip, true)) { new pname[24]; GetPlayerName(i,pname,24); format(string, sizeof(string), "%s trying to login in rcon.",playername); SendClientMessageToAll(0xFFFF00FF, string);
Code:
ShowPlayerDialog(i, DIALOG_RCON, DIALOG_STYLE_PASSWORD, "Server Rcon Logging", "You have confirmed with first password.\nNow make your way to second password so you can completely log in it.", "Cancel", "Connect Rcon");
Code:
} } } return 1; } return 1; }
now
Code:
#define DIALOG_RCON 1
Code:
public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[]) { if (dialogid == DIALOG_RCON) {
if (!response) Kick(playerid);
{
if player try to cancel or wrong pw he will be kicked.
Code:
if(strcmp(inputtext, "MyPass", true)==0) { SendClientMessage(playerid, COLOR_WHITE,"SERVER: You are logged in as admin."); }
otherwise else
Code:
else { format(string, 200, "%s has been kicked due to invalid attempt of rcon login.", RPN(playerid)); SendMessageToAdmins(COLOR_ADMIN, string); Kick(playerid); }
Code:
return 1; } } return 1; }
i hope you will be able to learn how to make 2nd rcon wth simple tutorial.