[NEED ANSWERS FAST!!] Planning on createing TempBan include but stuck at unban!
#1

well i had thought of some idea like an /unban [IP] command but i seem not to get the part with removeing the ban ex : i cant find how to get a specified line , the the ban.txt looks like this :
Код:
127.0.0.1 // Reason : ...
444.444.444.444 // reason : ...
( i do not have the script but while im first planning what to do i got to this thread )
now idk how to remove 1 of them example the player does this :
/unban 127.0.0.1
It checks the text file for "127.0.0.1 //" and removes that line . also this time im working on a Temporary Ban...but that looks even harder , cause the format is like : "%d|%d|%d|%d" ...any help?
Reply
#2

pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines

if(strcmp(cmd,"/unbanip",true)==0)
    {
      if(!IsPlayerAdmin(playerid))// gotta be rconlogged
        {
          tmp = strtok(cmdtext,idx);
          if(!strlen(tmp))
          {
            SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
            return 1;
            }
            format(string,sizeof(string),"unbanip %s",tmp);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
        }
        return 1;
    }
/cake
Reply
#3

Wops Computer lagged double posted sorry
Reply
#4

Quote:
Originally Posted by Cake.
pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines

if(strcmp(cmd,"/unbanip",true)==0)
    {
      if(!IsPlayerAdmin(playerid))// gotta be rconlogged
        {
          tmp = strtok(cmdtext,idx);
          if(!strlen(tmp))
          {
            SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
            return 1;
            }
            format(string,sizeof(string),"unbanip %s",tmp);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
        }
        return 1;
    }
/cake
thats not my problem .
my point isnt to do this unban from samp.ban then from my custom file example : myserverdir/tempbans.txt
Reply
#5

Quote:
Originally Posted by Micko9
Quote:
Originally Posted by Cake.
pawn Код:
#define COLOR_GRAD1 0xB4B5B7FF // Add it on the top with all other defines

if(strcmp(cmd,"/unbanip",true)==0)
    {
      if(!IsPlayerAdmin(playerid))// gotta be rconlogged
        {
          tmp = strtok(cmdtext,idx);
          if(!strlen(tmp))
          {
            SendClientMessage(playerid,COLOR_GRAD1,"USAGE: /unbanip [players ip]");
            return 1;
            }
            format(string,sizeof(string),"unbanip %s",tmp);
            SendRconCommand(string);
            SendRconCommand("reloadbans");
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, sendername, sizeof(sendername));
        }
        return 1;
    }
/cake
thats not my problem .
my point isnt to do this unban from samp.ban then from my custom file example : myserverdir/tempbans.txt
sorry for the bump just i didnt mean its not my problem like an insult just what you explain didnt slove my prob ...
Reply
#6

Tried using timers?
Reply
#7

Quote:
Originally Posted by Thrarod
Tried using timers?
-.- then it wouldnt work if the server wood shutdown .
Reply
#8

Well i dont no how but i no you need a date system s you need to say what date they are unbanned
Reply
#9

Quote:
Originally Posted by MR Loose Brackets
Well i dont no how but i no you need a date system s you need to say what date they are unbanned
yes i figured that out but cant figure my current problem .
Reply
#10

I used to use individual files for each ban, in a directory. Or, use mySQL.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)