How to unban?
#1

How do I unban someone from using this command?
Код:
COMMAND:ban(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 3)
	{
	    new adminname[MAX_PLAYER_NAME],pname[MAX_PLAYER_NAME],otherplayerid, reason[128];
	    GetPlayerName(otherplayerid,pname,sizeof(pname));
	    GetPlayerName(playerid,adminname,sizeof(adminname));
	    if(sscanf(params, "us", otherplayerid, reason))
	        SendClientMessage(playerid, COL_GREY, "/ban [PlayerID/PlayerName] [Reason]");
		else if(otherplayerid == INVALID_PLAYER_ID)
		    SendClientMessage(playerid, COL_GREY, "This player is not connected!");
		else
		{
			new string[32];
			format(string, sizeof(string), "You have been banned by %s! Reason: %s", adminname, reason);
			SendClientMessage(otherplayerid, 0xAAAAAAAA, string);
			Ban(otherplayerid);
		}
	}
	else
	{
	    SendClientMessage(playerid, 0xAAAAAAAA, "You are not the required level admin!");
	}
	return 1;
}
Reply
#2

You shoudl make a player variable for being banned, rather than using the pawno defined variable.

Ex: PlayerInfo[playerid][pBanned] = 1;

Then, under OnPlayerConnect, check to make sure that variable isnt "1", otherwise, they get kicked.

Then for the unban command, just make it open their file, and set the variable to 0.

Hope this helps, and if you want me to script it for you, PM me
Reply
#3

So regarding to yourself, and scripting for cash.

Quote:
Originally Posted by Joshb93
Посмотреть сообщение
You shoudl make a player variable for being banned, rather than using the pawno defined variable.
It's Should. "Ban(playerid)" isn't a pawno defined variable, LMAO.

Quote:
Originally Posted by Joshb93
Посмотреть сообщение
Then for the unban command, just make it open their file, and set the variable to 0.
You clearly don't know what you're saying, you just said that you just variable and you mention something about a file. , what variable is there to set when theres no connected player?

Quote:
Originally Posted by Joshb93
Посмотреть сообщение
Hope this helps, and if you want me to script it for you, PM me
Is this going for money?

____________

For something rather more simple. Try making a server sided banning technique, I'd suggest using SQLite/MYSQL since they have a great functionality towards doing such things.

If the player connects to the server simply open a query to check if the player is in the BANS table and then kick him from the server.
Reply
#4

LOL! LMFAO! You are such a dumbass!!!

You can open their file while their offline to, from IG!

You just got to know what your doing, dumbfuck!

Also, "Ban" is in the list alongside your pawno.exe, so, thats what i was referring to.. GTFO!

Loser++
Reply
#5

Actually Josh, Lorenc_ is right. Ban(playerid); is a function WITH SA-MP, but doesn't ban in the userfile. The function bans them on a IP basis. So to unban them, you need their IP, and '/rcon unbanip IP'. Although you can make a Ban function in your script, via enum or whatever it may be that you use. And Josh if you are to self-centered to believe me, just read this: https://sampwiki.blast.hk/wiki/Ban
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)