05.10.2014, 17:38
Hello guys, Is there a way/line/function to delete the samp.ban file? I really need it..
Thanks
Thanks
/rcon reloadbans
if(strcmp("/Bans", cmdtext, true, 10) == 0)
{
SendRconCommand("reloadbans");
return 1;
}
// 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.");
}