range ban command
#1

Hi guys. There are three random guys who enter the server earlier. Suddenly they start flooding server with some weird codes repeatedly and the website where they get the hacking tool. After trying to ban them many times they were still able to enter the server. I'am using an admin system but it doesn't have /rban command. Anyone would like to help me with rban command?
Reply
#2

Some helpful guy sendt me this. I am a beginner scripter, and i havent tested it, but i think this is also just for Y_ini.

public OnPlayerConnect(playerid)
{
if(PlayerInfo[playerid][pBanned] == 1 */or >=1 */) return Ban(playerid);
return 1;
}
Reply
#3

Quote:
Originally Posted by gnoomen2
View Post
Some helpful guy sendt me this. I am a beginner scripter, and i havent tested it, but i think this is also just for Y_ini.

public OnPlayerConnect(playerid)
{
if(PlayerInfo[playerid][pBanned] == 1 */or >=1 */) return Ban(playerid);
return 1;
}
At this point you dont know anything and your fr too , the thing you post is to check if player is ban but the guy already have one but the players that come (hackes,ban evading ) dont get ban becose im pretty sure he only block (ban) there nicknames

Reply
#4

Exactly doreto thanks for clearing it out. And I know you understand what I mean.
Reply
#5

pawn Code:
COMMAND:rangeban(playerid, params[])
{
            new Target;
            new Reason[100];
            if(!sscanf(params, "us[100]", Target,Reason))
            {
                if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR: Wrong player ID");
                if(Target == playerid) return SendClientMessage(playerid,-1,"ERROR: You cant ban yourself!");
                new tname[MAX_PLAYER_NAME];
                GetPlayerName(Target,tname,sizeof(tname));
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new MyString[256];
                new TargetString[256];
                new rbandate[3];
                getdate(rbandate[0], rbandate[1], rbandate[2]);
                format(MyString,sizeof(MyString),"You have range banned %s(%d)! (Reason: %s)",tname, Target, Reason);
                format(TargetString,sizeof(TargetString),"{FF002B}Range banned by: {FFFFFF}%s\n\n{FF002B}Reason: {FFFFFF}%s\n\n{FF002B}Date: {FFFFFF}%02d/%02d/%04d\n\n{FFFFFF}Press F8 to take a screenshot and use this in unban appeal!", pname, playerid,Reason, rbandate[2], rbandate[1], rbandate[0]);
                ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FF002B}RANGE BANNED!", TargetString, "OK", "");
                SendClientMessage(playerid,-1,MyString);
                new AllString[256];
                format(AllString,sizeof(AllString),"Administrator %s range banned player %s(%d)! (Reason: %s)",pname,tname,Target,Reason);
                SendClientMessageToAll(-1,AllString);
                new ip[50];
                GetPlayerIp(Target,ip,sizeof(ip));
                strdel(ip,strlen(ip)-4,strlen(ip));
                format(ip,sizeof(ip),"%s**.**",ip);
                format(ip,sizeof(ip),"banip %s",ip);
                SendRconCommand(ip);
                Kick(Target);
            }
            else SendClientMessage(playerid, -1, "USAGE: /rangeban <playerid> <reason>");
            return 1;
}
Reply
#6

Quote:
Originally Posted by fiki574_CRO
View Post
pawn Code:
COMMAND:rangeban(playerid, params[])
{
            new Target;
            new Reason[100];
            if(!sscanf(params, "us[100]", Target,Reason))
            {
                if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,-1,"ERROR: Wrong player ID");
                if(Target == playerid) return SendClientMessage(playerid,-1,"ERROR: You cant ban yourself!");
                new tname[MAX_PLAYER_NAME];
                GetPlayerName(Target,tname,sizeof(tname));
                new pname[MAX_PLAYER_NAME];
                GetPlayerName(playerid,pname,sizeof(pname));
                new MyString[256];
                new TargetString[256];
                new rbandate[3];
                getdate(rbandate[0], rbandate[1], rbandate[2]);
                format(MyString,sizeof(MyString),"You have range banned %s(%d)! (Reason: %s)",tname, Target, Reason);
                format(TargetString,sizeof(TargetString),"{FF002B}Range banned by: {FFFFFF}%s\n\n{FF002B}Reason: {FFFFFF}%s\n\n{FF002B}Date: {FFFFFF}%02d/%02d/%04d\n\n{FFFFFF}Press F8 to take a screenshot and use this in unban appeal!", pname, playerid,Reason, rbandate[2], rbandate[1], rbandate[0]);
                ShowPlayerDialog(playerid, 0, DIALOG_STYLE_MSGBOX, "{FF002B}RANGE BANNED!", TargetString, "OK", "");
                SendClientMessage(playerid,-1,MyString);
                new AllString[256];
                format(AllString,sizeof(AllString),"Administrator %s range banned player %s(%d)! (Reason: %s)",pname,tname,Target,Reason);
                SendClientMessageToAll(-1,AllString);
                new ip[50];
                GetPlayerIp(Target,ip,sizeof(ip));
                strdel(ip,strlen(ip)-4,strlen(ip));
                format(ip,sizeof(ip),"%s**.**",ip);
                format(ip,sizeof(ip),"banip %s",ip);
                SendRconCommand(ip);
                Kick(Target);
            }
            else SendClientMessage(playerid, -1, "USAGE: /rangeban <playerid> <reason>");
            return 1;
}
OMG! Fiki it works! Thanks + rep. Really appreciate your help. This is very important. I though it need some stock and oher admin stuff.
Reply
#7

Quote:
Originally Posted by .v
View Post
OMG! Fiki it works! Thanks + rep. Really appreciate your help. This is very important. I though it need some stock and oher admin stuff.
No problem mate!
Reply
#8

I saw that the code there didnt make any sence but the guy told me he was sure it would work, so i was just gonna try to help out and send it to you, thinking that it's better than nothing..lol
Reply
#9

Hey guys i know this is a old post but i tried Gansta's code on my server and BOOM it does work THANKS BRO!

Reply
#10

Quote:
Originally Posted by Hittop65
View Post
Hey guys i know this is a old post but i tried Gansta's code on my server and BOOM it does work THANKS BRO!

Really? Any need for that?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)