goddameit Posted January 27, 2013 Posted January 27, 2013 (edited) Preview :[media=] [/media]This script will create a new GM command to ban or unban specify IPand also record who ban it and who unban it.After you ban some IP, those user will be kicked out server and will not be able to use it for login server. @banip <IP> <reason reason reason>... @unbanip <IP> <reason reason reason>... Preview : http://bit.ly/VqCVY1 New SQL Table :CREATE TABLE IF NOT EXISTS `ipbanlist2` ( `list` varchar(255) NOT NULL default '', `ban_reason` varchar(255) NOT NULL default '', `unban_reason` varchar(255) NOT NULL default '', `status` tinyint(1) NOT NULL default '0', `ban_id` int(11) unsigned NOT NULL default '0', `unban_id` int(11) unsigned NOT NULL default '0', KEY (`list`) ) ENGINE=MyISAM; Script :ban_ip_atcommand_3.txtban_ip_atcommand_2.txtban_ip_atcommand.txtVersion3 : http://j.mp/11HRFnn-2 : http://bit.ly/VH7uVZ-1 : http://bit.ly/XKAhHu Edited February 16, 2013 by goddameit 2 Quote
Euphy Posted January 27, 2013 Posted January 27, 2013 Nice work, as always. :> I suggest you use the format: <IP> <reason> Currently the reason can only be one word, but you have set the SQL columns to varchar(255) and no words I know of are that long. xP You can then build a multi-word reason by either: Using string commands.set .@tmp$, implode(.@atcmd_parameters$," "); set .@reason$, substr(.@tmp$,getstrlen(.@atcmd_parameters$[0]),getstrlen(.@tmp$)-1); Looping.for(set .@i,1; .@i<.@atcmd_numparameters; set .@i,.@i+1) set .@reason$, .@reason$ + " " + .@atcmd_parameters$[.@i] .@atcmd_numparameters is fixed in r17106. 1 Quote
Capuche Posted January 27, 2013 Posted January 27, 2013 (edited) .@atcmd_numparameters is fixed in r17106. This fix still doesn't exist ! @goddameit 100 milliseconds for reading the reason... kick too fast lol Edited January 27, 2013 by Capuche Quote
Kyo Posted January 27, 2013 Posted January 27, 2013 This pretty much is a copy of my code, the only difference is, mine is source and you can use more than just a word as reason but great job, appreciate your work. Quote
goddameit Posted January 27, 2013 Author Posted January 27, 2013 (edited) If system work as I think, it will show message on your client, and if it doesn't close your client, you can read reason as video shown >> http://bit.ly/120XQ5F Edited January 27, 2013 by goddameit Quote
Capuche Posted January 27, 2013 Posted January 27, 2013 (edited) If system work as I think, it will show message on your client, and if it doesn't close your client, you can read reason as video shown >> http://bit.ly/120XQ5F True. But mine doesn't show anything (yes I have tried on my character, I'm a little masochist I guess). It depends on diff patch on launcher. Just a setting I guess Edited January 27, 2013 by Capuche Quote
QQfoolsorellina Posted January 27, 2013 Posted January 27, 2013 Suggestion: @banip <reason> <IP> {<IP range>} ragne value: d.d.d.* d.d.*.* d.*.*.* 2 Quote
goddameit Posted January 27, 2013 Author Posted January 27, 2013 (edited) Nice one, I will do it. - Update to ver.2 Version 2 :Add define range IP Sample : aaa.bbb.ccc.* aaa.*.*.* *.*.*.* // ban all of people Change input type @banip <IP> <reason> @unbanip <IP> <reason> Preview : http://bit.ly/VqCVY1 Edited February 5, 2013 by goddameit Quote
AnnieRuru Posted February 5, 2013 Posted February 5, 2013 your script doesn't really work I tried to ban myself (127.0.0.1) without *, it kicks me off, but I can login back like nothing happens and your script doesn't have enough command protection ... if ( !.@atcmd_numparameters ) message strcharinfo(0), "usage: @banip <ip> <reason>"; 2 Quote
goddameit Posted February 5, 2013 Author Posted February 5, 2013 your script doesn't really work I tried to ban myself (127.0.0.1) without *, it kicks me off, but I can login back like nothing happens and your script doesn't have enough command protection ... if ( !.@atcmd_numparameters ) message strcharinfo(0), "usage: @banip <ip> <reason>"; fixed, thanks for report Quote
Brian Posted February 6, 2013 Posted February 6, 2013 OnInit: bindatcmd "banip",strnpcinfo(3)+"::OnBan"; bindatcmd "unbanip",strnpcinfo(3)+"::OnUnBan"; end; Wouldn't this make the commands usable by anyone, since you didn't set an atcommand_level or charcommand_level? and there are no GM level/group checks within the script. *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; 1 Quote
goddameit Posted February 6, 2013 Author Posted February 6, 2013 OnInit: bindatcmd "banip",strnpcinfo(3)+"::OnBan"; bindatcmd "unbanip",strnpcinfo(3)+"::OnUnBan"; end; Wouldn't this make the commands usable by anyone, since you didn't set an atcommand_level or charcommand_level? *bindatcmd "command","<NPC object name>::<event label>"{,<atcommand level>,<charcommand level>}; I don't know is that need to set, so I didn't set it. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.