need help with ip ban
#1

I asked a good friend of mine to make me an good ipban command which he gave me this

Код:
CMD:permban(playerid, params[])
{
	if(IsPlayerAdmin(playerid) || pInfo[playerid][Admin] >= 4)
	{
  		new targetid, reason[64];
		if(sscanf(params, "us[64]", targetid, reason)) return SendClientMessage(playerid, error, "Usage: /permban [playerid] [reason]");
		new str[128];
		format(str, sizeof(str), "AdmCmd: An Administrator has permanently banned %s. [Reason: %s.]", GetName(targetid), reason);
		SendClientMessageToAll(red, str);
	    GameTextForPlayer(targetid, "~r~Banned", 5000, 5);
	    format(astring, sizeof(astring), "AdmCmd: You have been permanently banned from the server. You were banned by Administrator %s.", GetName(playerid));
	    SendClientMessage(targetid, red, astring);
	    SendClientMessage(targetid, red, "AdmCmd: If you think this ban is unfair post an appeal on our forums and take a screen shot of this message.");
   		BlockIpAddress(ReturnPlayerIp(targetid), 0);
	    SetTimerEx("BanPlayer",200,false,"ud", targetid,2);
       	CommandToAdmins(playerid,"permban");
	}
  	else return ShowMessage(playerid, error, 1);
	return 1;
}
the issue i have is, it kicks the player and if the player try's to rejoin or change there name it kicks them, but the issue is if i restart the whole server theip isn't banned again, so each time i do /rcon gmx, the ip wont be banned , can someone help me please
Reply
#2

https://sampforum.blast.hk/showthread.php?tid=606824

If you are interested in my invention! There is a range ban option as well.
For now, ip ban is as simple as this:
PHP код:
Ban(playerid); 
The data is saved in a SQLite or MySQL database (user's choice).
Reply
#3

I have no experience with MySQL, so could you just help me with that situation please
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)