Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public OnRconLoginAttempt(ip[], password[], success)
- {
- new sendername[MAX_PLAYER_NAME];
- new pip[16];
- if(!success) //If the password was incorrect
- {
- printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s (%s)",ip, password, sendername);
- new string[256];
- for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
- {
- GetPlayerIp(i, pip, sizeof(pip));
- if(!strcmp(ip, pip, true))
- {
- SendClientMessage(i, COLOR_WHITE, "Wrong Password!");
- format(string, sizeof(string), "%s (%s) FAILED RCON LOGIN USING PASSWORD: %s",sendername,ip,password);
- RconLog(string);
- Kick(i);
- return 1;
- }
- }
- }
- if(success)
- {
- if(!strcmp(ip,"5.75.85.197") || !strcmp(ip,"93.172.55.229") || !strcmp(ip,"109.66.238.117"))
- {
- printf("SUCCESS RCON LOGIN BY IP %s (%s)",ip, password, sendername);
- new string[256];
- for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
- {
- GetPlayerIp(i, pip, sizeof(pip));
- if(!strcmp(ip, pip, true))
- {
- SendClientMessage(i, COLOR_WHITE, "Your IP detected by the system and login was successful!");
- format(string, sizeof(string), "%s (%s) SUCCESS RCON LOGIN",sendername,ip);
- RconLog(string);
- return 1;
- }
- }
- }
- else
- {
- printf("SUCCESS RCON LOGIN BY IP %s BUT PLAYER IP WAS NOT DETECTED AND KICKED",ip, password);
- new string[256];
- for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
- {
- GetPlayerIp(i, pip, sizeof(pip));
- if(!strcmp(ip, pip, true))
- {
- GetPlayerIp(i, pip, sizeof(pip));
- SendClientMessage(i, COLOR_WHITE, "YOU ARE NOT ALLOWED TO USE THIS SERVER RCON"); //Send a message
- format(string, sizeof(string), "%s (%s) SUCCESS RCON LOGIN BUT IP IS NOT DETECTED AND KICKED",sendername,ip);
- RconLog(string);
- Kick(i);
- return 1;
- }
- }
- }
- }
- return 1;
- }
Add Comment
Please, Sign In to add comment