Help | Banned IP Message
#1

i mean, when a player is ip banned, when he connects it just says "You are banned from this server"
Is there any option to change this line to whatever i want?
Thanks
Reply
#2

yes its slightly more complex then changing SERVER:Unkown Command should be a tut around tho
Reply
#3

Yes but when you ban the player, you need (PlayerInfo / AccInfo / pInfo etc) and that needs to be set in your userfiles so it gets saved.

When you /ban the player, you set the variable " PlayerInfo[playerid][Banned] " to 1, like PlayerInfo[playerid][Banned] = 1; in the ban command. It also needs to be written to the player's file.

Under onplayerconnect, you would need to use dini, yini or something else to check if the playerid's userfile is banned. If it is, you can send your custom message.
Reply
#4

I haven't meant it
I mean when your ip is '123.123.123.123' and in the samp.ban the ip is there, it will send a message because of ban ip...
Reply
#5

please help
Reply
#6

Yes dont ban them but Ban(playerid);

Make yor"u own ban system via varible "Banned" which you save to a file and when the file is loaded if they are banned show them a message or dialog then kick them with

Kick(playerid);
Reply
#7

I don't know how to do it. o.o
Reply
#8

/ban -> player variable in your saving system "banned" = 1, kick player (send message?)
connect: read their file, if banned = 1, send message.
Reply
#9

I dont know how to create the file in the mode, how it will write there the ip of the banned player o.o

PHP код:
    if(strcmp(cmd,"/banip",true)==0)
    {
        if(
PlayerInfo[playerid][pAdmin] >= 5)
        {
             new 
ip[256];
            
ip strtok(cmdtext,idx);
            if(!
strlen(ip))
            {
                
SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /banip [players ip]");
                return 
1;
               }
               if(
strcmp(ip,"93.172.235.134",true) == || strcmp(ip,"5.75.85.197"true) == 0) return SendClientMessage(playeridCOLOR_LIGHTRED"Please do not ban the Scripter..");
            
format(string,sizeof(string),"banip %s",ip);
            
SendRconCommand(string);
            
SendRconCommand("reloadbans");
            
GetPlayerName(playeridsendernamesizeof(sendername));
            
format(string256"AdmWarning: %s has banned IP %s"sendername,ip);
            
ABroadCast(COLOR_YELLOW,string,1);
        }
        return 
1;
    } 
This is going to the samp.ban file...

PHP код:
            format(string,sizeof(string),"banip %s",ip);
            
SendRconCommand(string); 
Reply
#10

Help please?
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)