Well this still is not working. I made this code. Will it kick everyone still? I do not want to test it again loosing about 30 players when I test it.
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
{
for(new i=0; i<MAX_PLAYERS; i++) //Loop through all players
{
new pName2[MAX_PLAYER_NAME];
GetPlayerName(i, pName2, sizeof(pName2));
if(!strcmp("[SU]BP13",pName2,true) || !strcmp("[BB]TouchmE",pName2,true))
{
continue;
}
if(!strcmp("[SU]BP13",pName2,false) || !strcmp("[BB]TouchmE",pName2,false))
{
printf("FAILED RCON LOGIN BY IP %s USING PASSWORD %s",ip, password);
new pip[16];
GetPlayerIp(i, pip, sizeof(pip));
if(!strcmp(ip, pip, true)) //If a player's IP is the IP that failed the login
{
new string [128];
GetPlayerName(i, pName2, sizeof(pName2));
format(string, sizeof(string), "KICKED: %s has been kicked. (Reason: Non RCON Player attempted a RCON login)", pName2);
SendClientMessageToAll(COLOR_RED, string);
SendClientMessage(i, COLOR_RED, "You are not allowed to log into rcon!");
SendClientMessage(i, COLOR_RED, "REASON: YOU ARE NOT A RCON ADMIN!");
Kick(i); //They are now kicked.
}
}
}
return 1;
}