Name ban,and IP ban
#1

Hello peoples.I want to ask.I have created ban system who if player first time banned he get name ban,but one problem,I don't know when player get name ban,and he come again with another name,and get ban again,he get IP ban,how to do that?
Reply
#2

If you asking how to ban a player's IP. Use the Ban function.

https://sampwiki.blast.hk/wiki/Ban
Reply
#3

save there IP as banned under ban command. On connect check if they have a banned IP, if so kick them as a banned IP.
Reply
#4

Код:
for(new v = 0; v < MAX_PLAYERS; v ++ )
{
new pIP [ 50 ];
new pFiles [ 50 ];
format(pFiles, sizeof(pFiles), "saves/user/%s.ini", PlayerName(v));
new Ipas = dini_Int(pFiles,"IP Adresas");
new Banas = dini_Int(pFiles,"Banned");
if(dini_Exists(pFiles)){
if(GetPlayerIp(IDs, pIP, sizeof(pIP) == Ipas && Banas == 1 ))
{
Ban( IDs );
What is wrong in this code?
Reply
#5

GetPlayerIp is used wrongly and returns a string, not an integer - you can't compare IP addresses like that;

https://sampwiki.blast.hk/wiki/GetPlayerIp
Reply
#6

Then how to do that?Help me i have almost have created my ban system only this needed.
Reply
#7

pawn Код:
if (strcmp(cmdtext, "/banip", true) == 0)
    {

        if(IsPlayerAdmin(playerid))
        {
         new string[200], pname[28];
         GetPlayerName(playerid, pname, sizeof(pname));
         format(string,sizeof(string),"%s banned the Ip %s",pname,cmd);
         SendClientMessageToAll(0xDEEE20FF, string);
         SendRconCommand("banip");

         return 1;
        }
        else
        {
        SendClientMessage(playerid, COLOR_YELLOW, "You are not admin");
        return 1;
        }
    }
Reply
#8

pawn Код:
format(string,sizeof(string),"%s banned the Ip %s",pname,cmd);
         SendClientMessageToAll(0xDEEE20FF, string);
         SendRconCommand("banip");
and that won't work. You have to format command also in format "format(command,sizeof(command),"banip %s", Ip); and then use SendRconCommand(command);
Reply
#9

You don't understand,i repeat again that what i need.First of all,when admin ban player for first time,player gets NAME BAN,I have do that,but i want,when player come back to server with another name,and get again ban he not get no name ban but IP BAN,how to do that?
Reply
#10

So to make variable for Ip that will check if player's connect IP has already been used with banned nickname., If Yes, to ban him?
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)