26.09.2010, 19:15
Hi
How to limit connections to rcon remotely
Thanks
How to limit connections to rcon remotely
Thanks
#define MAX_RCONS 2 //2 RCON logins total.
OnRconLoginAttempt(ip[], password[], success)
{
new count;
for(new i; i <= MAX_PLAYERS; i++) {
if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
count++;
}
}
if(count >= MAX_RCONS) return 0;
return 1;
}
maxrcon [num]
//global
#define MAX_RCON_LOGINS your_limit_here
static
g_AdminsOnline;
public OnRconCommand(cmd[])
{
if( !strcmp( cmd, "login your_rcon_password_here" ))
{
if( g_AdminsOnline == MAX_RCON_LOGINS )
{
print("rcon login not successful - too many admins online");
return false;
}
g_AdminsOnline++;
return true;
}
return false;
}