Anyway to delete sa-mp.ban file using a command/line in pawno? - 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: Anyway to delete sa-mp.ban file using a command/line in pawno? (
/showthread.php?tid=540568)
Anyway to delete sa-mp.ban file using a command/line in pawno? -
ZombieNest - 05.10.2014
Hello guys, Is there a way/line/function to delete the samp.ban file? I really need it..
Thanks
Re: Anyway to delete sa-mp.ban file using a command/line in pawno? -
Pottus - 05.10.2014
You can use file function plugins of course.
Answer -
Ygzeb - 05.10.2014
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:
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
Re: Anyway to delete sa-mp.ban file using a command/line in pawno? -
Vince - 05.10.2014
rcon unbanip *.*.*.* should do it, I guess. Won't delete the file itself, but it should clear all bans in it.