Anyway to delete sa-mp.ban file using a command/line in pawno?
#1

Hello guys, Is there a way/line/function to delete the samp.ban file? I really need it..
Thanks
Reply
#2

You can use file function plugins of course.
Reply
#3

Well, it would be difficult to do it just with a line or code.

But you can delete samp.ban file manually and then in game you can use:

Код:
/rcon reloadbans
Or you can create a command like this one:

pawn Код:
if(strcmp("/Bans", cmdtext, true, 10) == 0)
{
SendRconCommand("reloadbans");
return 1;
}
You can also use dcmd to unban only one specific IP:

pawn Код:
// You define DCMD at the top:

#define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1

// In OnPlayerCommandText:

public OnPlayerCommandText(playerid, cmdtext[])
{
dcmd(unbanip, 7, cmdtext);
// Commands...

// You put this out of publics and other functions:

dcmd_unbanip(playerid, params[])
{
if(IsPlayerAdmin(playerid))
{
new Str[25]; // Array.
if(!strlen(params)) return SendClientMessage(playerid, 0xFF0000AA, "Use: /Unban IP"); // Right use of the command.
format(Str, sizeof(Str), "unbanip %s", params); // We unban the IP.
SendRconCommand(Str);
SendRconCommand("reloadbans");
return SendClientMessage(playerid, 0xFFA600AA, "Unbanned successfully.");
}
else return SendClientMessage(playerid, 0xFF0000AA, "Command only for administrators.");
}
Good luck
Reply
#4

rcon unbanip *.*.*.* should do it, I guess. Won't delete the file itself, but it should clear all bans in it.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)