Código:
#define FILTERSCRIPT
#include <a_samp>
#include <YSI_Data\y_iterate>
#define MAX_NICKS 4
#define RCON_PASSWORD_SIZE 256
new const NICKS_PERMITIDOS[MAX_NICKS][MAX_PLAYER_NAME] = {
    "Nick1",
    "Nick2",
    "Nick3",
    "Nick4"
};
const RCON_PASSWORD[RCON_PASSWORD_SIZE] = "sua_senha_segura"; // Definindo o tamanho da senha RCON
#define COLOR_SUCCESS 0x00FF00FF // Verde
#define COLOR_ERROR 0xFF0000FF   // Vermelho
#define COLOR_WARNING 0xFFFF00FF  // Amarelo
#define MESSAGE_LOGIN_SUCCESS "Login RCON bem-sucedido."
#define MESSAGE_LOGIN_FAILED "Senha incorreta. Acesso negado."
#define MESSAGE_NO_PERMISSION "Você não tem permissão para acessar o RCON."
// Função que verifica se o nick é permitido
stock bool IsNickPermitted(const nick[]) {
    for (new j = 0; j < MAX_NICKS; j++) {
        if (!strcmp(nick, NICKS_PERMITIDOS[j], true)) {
            return true; // Nick permitido
        }
    }
    return false; // Nick não permitido
}
#if defined FILTERSCRIPT
public OnFilterScriptInit() {
    print("\n--------------------------------------");
    print(" [FS] Sistema de Segurança RCON Ativado");
    print("--------------------------------------\n");
    return 1;
}
// Função que gerencia a tentativa de login RCON
public OnRconLoginAttempt(ip[], password[], success) {
    new bool hasAccess = false; // Variável para controle de acesso
    new senderName[MAX_PLAYER_NAME], senderIp[16];
    foreach (new playerId : Player) {
        GetPlayerName(playerId, senderName, sizeof(senderName));
        GetPlayerIp(playerId, senderIp, sizeof(senderIp));
        // Verifica se o IP do cliente corresponde ao IP da tentativa de login
        if (!strcmp(ip, senderIp, true)) {
            if (IsNickPermitted(senderName)) {
                if (!strcmp(password, RCON_PASSWORD, true)) {
                    SendClientMessage(playerId, COLOR_SUCCESS, MESSAGE_LOGIN_SUCCESS);
                    hasAccess = true; // Acesso concedido
                } else {
                    SendClientMessage(playerId, COLOR_ERROR, MESSAGE_LOGIN_FAILED);
                }
            } else {
                SendClientMessage(playerId, COLOR_WARNING, MESSAGE_NO_PERMISSION);
            }
            break; // Para sair do loop assim que o IP correspondente for encontrado
        }
    }
    
    return hasAccess ? 1 : 0; // Retorna 1 se o acesso foi concedido, caso contrário retorna 0
}
#endif