SA-MP Forums Archive
Help | Banned IP Message - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Help | Banned IP Message (/showthread.php?tid=289308)



Help | Banned IP Message - arad55 - 11.10.2011

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


Re: Help | Banned IP Message - DaRkAnGeL[NBK] - 11.10.2011

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


Re: Help | Banned IP Message - grand.Theft.Otto - 11.10.2011

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.


Re: Help | Banned IP Message - arad55 - 11.10.2011

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...


Re: Help | Banned IP Message - arad55 - 11.10.2011

please help


Re: Help | Banned IP Message - IceCube! - 11.10.2011

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);


Re: Help | Banned IP Message - arad55 - 11.10.2011

I don't know how to do it. o.o


Re: Help | Banned IP Message - Scarred - 11.10.2011

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


Re: Help | Banned IP Message - arad55 - 11.10.2011

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); 



Re: Help | Banned IP Message - arad55 - 12.10.2011

Help please?