Anti ban evade
#1

I want to make anti ban evade so If player got banned he will be automatically kick by the server.So I changed banned=1 in my accname.txt.And I put this code at OnPlayerConnect :
PHP код:
if (dini_Int(savefolder"banned") == 1)
    {
    
SendClientMessage(playerid,COLOR_PURPLE,"* You was banned from this server *");
    
Kick(playerid);
    } 
But when I tried to connect it doesn't kick me.Any solution for this?
Reply
#2

Why not trying it with a PlayerInfo[playerid][pBanned] type thing? Like for example, this is my old banned from server code before I gave my script a massive overhaul, and updated the MySQL. If you'd like I can track down my old .ini one of this script too and show you how it's done there? I think I still have it somewhere, I keep a backup of atleast each version I do

Код:
	format(cmdd, sizeof(cmdd), "SELECT `IP` FROM `bans` WHERE `IP`='%s' LIMIT 1;", ip);
	mysql_query(cmdd);
	mysql_store_result();
	if (mysql_num_rows() != 0)
	{
		SendClientMessage(playerid, COLOR_BRIGHTRED, "You are banned from this server!");
		Kick(playerid);
		return 1;
	}
	format(cmdd, sizeof(cmdd), "SELECT `Username` FROM `bans` WHERE `Username`='%s' LIMIT 1;", name);
	mysql_query(cmdd);
	mysql_store_result();
	if (mysql_num_rows() != 0)
	{
		SendClientMessage(playerid, COLOR_BRIGHTRED, "You are banned from this server!");
		Kick(playerid);
		return 1;
	}
Or you could also do it when it loads the ini file, for example.
Код:
		if(PlayerInfo[playerid][pBand] == 3)
		{
		    new banstring[256];
		    format(banstring,sizeof(banstring),"AdmCmd: %s has been banned, reason: Attempting to log into a banned account.",PlayerName(playerid));
		    SendClientMessageToAll(COLOR_LIGHTRED,banstring);
		}
Reply
#3

Im using DINI
Reply
#4

Indeed, the last line, where it says pBand, that ones for a Dini script. Where it loads the file, it basically kicks you if you're "Banned" thing is equal to 3. Also, take my advice. I recommend updating to BlueG's MySQL R7 as soon as you can. It's much faster, and I don't think any script uses DINI anymore. You should have a fairly easy time with MySQL. In my opinion, it's easy. I learned it in under an hour xD
Reply
#5

Quote:
Originally Posted by Jay_Dixon
Посмотреть сообщение
Indeed, the last line, where it says pBand, that ones for a Dini script. Where it loads the file, it basically kicks you if you're "Banned" thing is equal to 3. Also, take my advice. I recommend updating to BlueG's MySQL R7 as soon as you can. It's much faster, and I don't think any script uses DINI anymore. You should have a fairly easy time with MySQL. In my opinion, it's easy. I learned it in under an hour xD
You can't learn everything about MySQL in an hour, it's not possible. MySQL itself is an entirely different scripting language (just like PAWN). Your advice of updating to R7 is also not really something that would be recommended anymore. R7 is considerably old and as such isn't getting updates. Such an old version has bugs, (possible) security issues and other limitations whereas a version such as R45 is being constantly updated.
Reply
#6

So this is what my ban cmd do :
PHP код:
dUserSetINT(PlayerName2(player1)).("banned",1); 
With that codes,how can I check it at OnPlayerConnect like if YINI I can do something like
PHP код:
if(PlayerInfo[playerid][Banned] == 1)
{
Kick(playerid);

Reply
#7

Sorry for bump but I really need the solution
Reply
#8

Bump :/
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)