SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 27/11/2011, 08:26 AM   #1
Vic1990
Little Clucker
 
Vic1990's Avatar
 
Join Date: Nov 2011
Location: Australia.
Posts: 49
Reputation: 0
Default How to unban?

How do I unban someone from using this command?
Code:
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;
}
Vic1990 is offline   Reply With Quote
Old 27/11/2011, 08:37 AM   #2
Joshb93
Huge Clucker
 
Join Date: Nov 2011
Posts: 254
Reputation: 34
Default Re: How to unban?

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
Joshb93 is offline   Reply With Quote
Old 27/11/2011, 08:43 AM   #3
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 3,800
Reputation: 1160
Default Re: How to unban?

So regarding to yourself, and scripting for cash.

Quote:
Originally Posted by Joshb93 View Post
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 View Post
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 View Post
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.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.sfcnr.com:7777

Lorenc_ is offline   Reply With Quote
Old 27/11/2011, 08:46 AM   #4
Joshb93
Huge Clucker
 
Join Date: Nov 2011
Posts: 254
Reputation: 34
Default Re: How to unban?

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++
Joshb93 is offline   Reply With Quote
Old 27/11/2011, 09:41 AM   #5
.:Kaos:.
Big Clucker
 
.:Kaos:.'s Avatar
 
Join Date: Sep 2011
Posts: 72
Reputation: 9
Default Re: How to unban?

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: http://wiki.sa-mp.com/wiki/Ban
.:Kaos:. is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Unban emokidx Help Archive 2 29/07/2011 12:52 PM
Unban cmd help? Snipa Help Archive 8 10/11/2010 10:13 PM
/unban TheGtaLover Help Archive 6 12/02/2010 12:54 AM
Unban help Naruto4 Help Archive 8 28/11/2009 05:01 PM
unban in FS Mikeses Help Archive 0 14/06/2009 02:12 PM


All times are GMT. The time now is 12:01 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.