27.08.2015, 23:18
Код:
public OnRconLoginAttempt(ip[], password[], success)
{
new cheaterName[MAX_PLAYER_NAME],
cheaterIp[64],
string[512];
for(new j=0; j<=MAX_PLAYERS; j++)
{
if(IsPlayerConnected(j))
{
GetPlayerIp(j, cheaterIp, sizeof(cheaterIp));
if(strcmp(cheaterIp, ip, true))
{
GetPlayerName(j, cheaterName, sizeof(cheaterName));
}
}
}
if(!success)
{
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
format(string, sizeof(string), "** Warning: {FFFFFF}%s (%d) tried to RCON login with the password '%s' and fails.", cheaterName, GetPlayerIdFromName(cheaterName), password);
SendClientMessage(i, COLOR_ACHAT, string);
}
}
}
}else if(success && (PlayerInfo[GetPlayerIdFromName(cheaterName)][pAdmin] > 0))
{
for(new i=0; i<=MAX_PLAYERS; i++)
{
if(IsPlayerConnected(i))
{
if(PlayerInfo[i][pAdmin] > 0)
{
format(string, sizeof(string), "** Admin %s (%d) has successfully RCON logged in.", cheaterName, GetPlayerIdFromName(cheaterName));
SendClientMessage(i, COLOR_ACHAT, string);
}
}
}
}else if(success && (PlayerInfo[GetPlayerIdFromName(cheaterName)][pAdmin] == 0))
{
format(string, sizeof(string), "** %s has been automatically kicked from the server for RCON logging in not being an admin.", cheaterName);
SendClientMessageToAll(COLOR_ERROR, string);
DelayedKick(GetPlayerIdFromName(cheaterName));
}
return 1;
}
P.S. I have no idea what I did wrong here xD

