SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 03/05/2013, 06:13 PM   #1
Lucky™
Huge Clucker
 
Lucky™'s Avatar
 
Join Date: Jul 2012
Location: Tomorrowland
Posts: 252
Reputation: 63
Default Rcon login = ban

Hello SA:MP forum, I have small problem. I need to do If someone typed /rcon login [pass] in game He will get auto banned [range ban] and Also he will get auto banned even he typed the correct password.

Is it possible?

Thank you!
Lucky™ is offline   Reply With Quote
Old 03/05/2013, 06:14 PM   #2
Jimmy0wns
Gangsta
 
Join Date: Sep 2012
Location: Netherlands
Posts: 686
Reputation: 208
Default Re: Rcon login = ban

Why would you also ban him when he types a correct password?
Jimmy0wns is offline   Reply With Quote
Old 03/05/2013, 06:18 PM   #3
Lucky™
Huge Clucker
 
Lucky™'s Avatar
 
Join Date: Jul 2012
Location: Tomorrowland
Posts: 252
Reputation: 63
Default Re: Rcon login = ban

Quote:
Originally Posted by Jimmy0wns View Post
Why would you also ban him when he types a correct password?
For security reasons
Lucky™ is offline   Reply With Quote
Old 03/05/2013, 06:24 PM   #4
vvhy
Big Clucker
 
Join Date: Mar 2012
Posts: 145
Reputation: 11
Default Re: Rcon login = ban

You could just disable rcon by putting
Code:
rcon 0
in the server config file
__________________
My work:
__________________________________________________ ______
MAPS

House Interior
Bank Interior
vvhy is offline   Reply With Quote
Old 03/05/2013, 06:25 PM   #5
Scenario
Godfather
 
Scenario's Avatar
 
Join Date: Feb 2010
Location: Heaven
Posts: 7,801
Reputation: 701
Default Re: Rcon login = ban

Quote:
Originally Posted by vvhy View Post
You could just disable rcon by putting
Code:
rcon 0
in the server config file
That doesn't disable rcon. That disables REMOTE rcon, making it so people can't remotely access the server's rcon.
Scenario is offline   Reply With Quote
Old 03/05/2013, 06:28 PM   #6
vvhy
Big Clucker
 
Join Date: Mar 2012
Posts: 145
Reputation: 11
Default Re: Rcon login = ban

Alright, heres what you asked for:

pawn Code:
public OnRconLoginAttempt(ip[], password[], success)
{
    new pip[16];
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        GetPlayerIp(i, pip, sizeof(pip));
        if(!strcmp(ip, pip, true))
        {
            Ban(i);
        }
    }
    return 1;
}
__________________
My work:
__________________________________________________ ______
MAPS

House Interior
Bank Interior
vvhy is offline   Reply With Quote
Old 03/05/2013, 06:30 PM   #7
DobbysGamertag
Gangsta
 
DobbysGamertag's Avatar
 
Join Date: Jan 2013
Location: England
Posts: 808
Reputation: 100
Default Re: Rcon login = ban

pawn Code:
#define RCON_NAME "changeme"

//===============

public OnRconLoginAttempt(ip[],password[],success)
{
    new Name[24],Ip[16];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerIp(i,Ip,sizeof(Ip));
            if(!strcmp(ip,Ip))
            {
                GetPlayerName(i,Name,sizeof(Name));
                if(strcmp(Name,RCON_NAME))
                {
                    SendClientMessage(i,-1,"Oops. You're banned.");
                    BanEx(i, "RCON LOGIN ATTEMPTS" );
                }
            }
        }
    }
    return 1;
}

Saves to file with "RCON login attempts next to the name / ip. define RCON Name locks it so only the defined name can acess it
__________________

Releases:
[include] SAMP Dynamic Zones - An up to date a_zones.inc
DobbysGamertag is offline   Reply With Quote
Old 03/05/2013, 06:35 PM   #8
Lucky™
Huge Clucker
 
Lucky™'s Avatar
 
Join Date: Jul 2012
Location: Tomorrowland
Posts: 252
Reputation: 63
Default Re: Rcon login = ban

Quote:
Originally Posted by DobbysGamertag View Post
pawn Code:
#define RCON_NAME "changeme"

//===============

public OnRconLoginAttempt(ip[],password[],success)
{
    new Name[24],Ip[16];
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            GetPlayerIp(i,Ip,sizeof(Ip));
            if(!strcmp(ip,Ip))
            {
                GetPlayerName(i,Name,sizeof(Name));
                if(strcmp(Name,RCON_NAME))
                {
                    SendClientMessage(i,-1,"Oops. You're banned.");
                    BanEx(i, "RCON LOGIN ATTEMPTS" );
                }
            }
        }
    }
    return 1;
}

Saves to file with "RCON login attempts next to the name / ip. define RCON Name locks it so only the defined name can acess it
Thanks, Gonna try this out.

@Everyone - Thanks everyone
Lucky™ is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
/rcon login HELP! Pesa Scripting Help 3 10/09/2012 06:22 AM
[FilterScript] [R.P.S] Rcon Protection System (/rSenha) [/rcon login = kick] Diogo_Bras Lançamentos/Releases 14 30/04/2011 03:57 PM
How y login with rcon ? benedek Help Archive 2 01/01/2011 09:57 AM
HELP:i cant login as rcon using remote console or /rcon login rconpass ingame greekboy Help Archive 3 21/10/2010 12:43 PM
Cant login in rcon krisis32 Help Archive 9 10/04/2009 03:16 PM


All times are GMT. The time now is 05:32 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.