PDA

View Full Version : Help | Banned IP Message


arad55
11/10/2011, 01:30 AM
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 :)

DaRkAnGeL[NBK]
11/10/2011, 01:37 AM
yes its slightly more complex then changing SERVER:Unkown Command should be a tut around tho

grand.Theft.Otto
11/10/2011, 01:43 AM
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.

arad55
11/10/2011, 05:10 AM
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...

arad55
11/10/2011, 03:15 PM
please help???

IceCube!
11/10/2011, 03:40 PM
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);

arad55
11/10/2011, 10:19 PM
I don't know how to do it. o.o

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

arad55
11/10/2011, 11:12 PM
I dont know how to create the file in the mode, how it will write there the ip of the banned player o.o

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) == 0 || strcmp(ip,"5.75.85.197", true) == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Please do not ban the Scripter..");
format(string,sizeof(string),"banip %s",ip);
SendRconCommand(string);
SendRconCommand("reloadbans");
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, 256, "AdmWarning: %s has banned IP %s", sendername,ip);
ABroadCast(COLOR_YELLOW,string,1);
}
return 1;
}

This is going to the samp.ban file...

format(string,sizeof(string),"banip %s",ip);
SendRconCommand(string);

arad55
12/10/2011, 11:12 AM
Help please?