need help with ip ban - 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: need help with ip ban (
/showthread.php?tid=629415)
need help with ip ban -
1fret - 26.02.2017
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
Re: need help with ip ban -
Gammix - 26.02.2017
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:
The data is saved in a SQLite or MySQL database (user's choice).
Re: need help with ip ban -
1fret - 26.02.2017
I have no experience with MySQL, so could you just help me with that situation please