Raised This Month: $ Target: $400
 0% 

Add a unban command in ban config.


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-16-2010 , 11:48   Add a unban command in ban config.
Reply With Quote #1

This is a code that I found, I want a unban command.
It`s possible?
Code:
#include <amxmodx>
#include <amxmisc>

#define PLUGIN "Ban Config"
#define VERSION "1.0"
#define AUTHOR "Alka"

new const gBanKey[] = "_key";

public plugin_init() {
	
	register_plugin(PLUGIN, VERSION, AUTHOR);
	
	register_concmd("amx_bancfg", "cmdBanConfig", ADMIN_BAN, "<#name/userid> <#time>");
}

public cmdBanConfig(id, level, cid)
{
	if(!cmd_access(id, level, cid, 3))
		return 1;
	
	new sArg[32], sArg1[10];
	read_argv(1, sArg, sizeof sArg - 1);
	read_argv(2, sArg1, sizeof sArg1 - 1);
	
	new iTarget = cmd_target(id, sArg, 0);
	
	if(!iTarget)
		return 1;
	
	new iBanTime = ((str_to_num(sArg1) * 60) + get_systime());
	
	if(str_to_num(sArg1) <= 0)
		iBanTime = 9999999999;
	
	client_cmd(iTarget, "developer 1;wait;setinfo %s %d", gBanKey, iBanTime);
	
	switch(get_cvar_num("amx_show_activity"))
	{
		case 0: { return 1; }
		case 1:
		{
			new sTargetName[32];
			get_user_name(iTarget, sTargetName, sizeof sTargetName - 1);
			
			client_print(0, print_chat, "ADMIN: ban %s`s config", sTargetName);
		}
		case 2:
		{
			new sAdminName[32];
			get_user_name(id, sAdminName, sizeof sAdminName - 1);
			
			new sTargetName[32];
			get_user_name(iTarget, sTargetName, sizeof sTargetName - 1);
			
			client_print(0, print_chat, "ADMIN %s: ban %s`s config", sAdminName, sTargetName);
		}
	}
	
	server_cmd("kick #%d ^"Banned^"", get_user_userid(iTarget));
	
	return 1;
}

public client_connect(id)
{
	new sInfo[32];
	get_user_info(id, gBanKey, sInfo, sizeof sInfo - 1);
	
	if(strlen(sInfo) > 0)
	{
		if(get_systime() < str_to_num(sInfo))
		{
			server_cmd("kick #%d ^"Banned^"", get_user_userid(id));
			return;
		}
	}
}
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-16-2010 , 11:52   Re: Add a unban command in ban config.
Reply With Quote #2

Worst method to ban someone.

There is no way for the server to delete a setinfo line, so you would have to check the value.
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-16-2010 , 12:41   Re: Add a unban command in ban config.
Reply With Quote #3

um...This amxx I want to ban the non steam player, because so many non steam player is no-ip.
I have some idea, but because I am newbie so I could not do it myself.
when an admin using the amx_bancfg, he must enter a value, then the value will save in a file, when the player connect, check setinfo _key <value>.
If the value is in the file then disconnect the player.
And with the unban command, I think should like this, amx_unbancfg <value>, then auto delete the value in file then the player can connect.
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-16-2010 , 13:22   Re: Add a unban command in ban config.
Reply With Quote #4

Quote:
Originally Posted by YamiKaitou View Post
There is no way for the server to delete a setinfo line, so you would have to check the value.

Also, No Steam = No Support
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
sb123
Senior Member
Join Date: Jan 2007
Old 08-16-2010 , 16:54   Re: Add a unban command in ban config.
Reply With Quote #5

Using this plugins
http://amxx.pl/extremebanconfig-30-beta-t25515.html
sb123 is offline
Send a message via ICQ to sb123 Send a message via MSN to sb123 Send a message via Yahoo to sb123
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-16-2010 , 22:29   Re: Add a unban command in ban config.
Reply With Quote #6

Quote:
Originally Posted by YamiKaitou View Post
Also, No Steam = No Support
But me is steam, server for steam and non steam player.


Quote:
Originally Posted by GarbageBox View Post
But me is steam, server for steam and non steam player.
Thank you~
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others

Last edited by GarbageBox; 08-16-2010 at 22:35.
GarbageBox is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-16-2010 , 22:30   Re: Add a unban command in ban config.
Reply With Quote #7

Quote:
Originally Posted by GarbageBox View Post
But me is steam, server for steam and non steam player.
Doesn't matter. Your server allows Non-Steam players to connect, therefore you are promoting Non-Steam, meaning you will not get support here
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 08-17-2010 , 01:03   Re: Add a unban command in ban config.
Reply With Quote #8

The whole point here is that if you remove the non-Steam part it fixes your problem completely. So, that is the only advice you will get, stop using non-Steam.
__________________
fysiks is offline
GarbageBox
Senior Member
Join Date: Feb 2010
Old 08-18-2010 , 01:59   Re: Add a unban command in ban config.
Reply With Quote #9

Quote:
Originally Posted by YamiKaitou View Post
Doesn't matter. Your server allows Non-Steam players to connect, therefore you are promoting Non-Steam, meaning you will not get support here
Different point of view, but I understand it.
The server of course host by me, but the boss is not me and I just try to do my best with the plugin part.
Other things I will not be considered within the scope of.

Quote:
Originally Posted by fysiks View Post
The whole point here is that if you remove the non-Steam part it fixes your problem completely. So, that is the only advice you will get, stop using non-Steam.
My question has largely been resolved, thank!
And what is your meaning for stop using non-steam?
You are talking about me, right?
If yes, I tell you I has stop using the non steam since i bought steam.
__________________
You can be a SUPER coder but you Haven't to say such as "stupid, etc." words to the others
GarbageBox is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 08-18-2010 , 08:49   Re: Add a unban command in ban config.
Reply With Quote #10

Remove the ability for Non-Steam users to connect to you server.

That is what fysiks was trying to tell you. If you do that, then you can ban by SteamID and not have to worry about using this horrible method to ban someone
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Reply



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

Forum Jump


All times are GMT -4. The time now is 21:58.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode