youtube Posted July 30, 2013 Posted July 30, 2013 (edited) guys how can i ask @commands like @banip to ban IP with time example your account has bee im using EA Edited July 30, 2013 by youtube Quote
Zeiyan Posted July 30, 2013 Posted July 30, 2013 http://rathena.org/board/topic/77910-ban-ip-ver3/ this? Quote
youtube Posted July 30, 2013 Author Posted July 30, 2013 /* Author Goddameit Version 2013/02/06 Web http://bit.ly/MDuQ9F Special thanks for : Euphy >> New 'reason' and command input type QQfoolsorellina >> IP range check concept AnnieRuru >> command protection and Bug report */ - script ban_ip_atcommand -1,{ OnInit: bindatcmd "banip",strnpcinfo(3)+"::OnBan"; bindatcmd "unbanip",strnpcinfo(3)+"::OnUnBan"; end; OnBan: if ( !.@atcmd_numparameters ) { message strcharinfo(0), "usage: @banip <ip> <reason>"; end; } set .@atcmd_parameters$[0],escape_sql(.@atcmd_parameters$[0]); set .@atcmd_parameters$[1],escape_sql(.@atcmd_parameters$[1]); set .@tmp$, implode(.@atcmd_parameters$," "); set .@reason$, substr(.@tmp$,getstrlen(.@atcmd_parameters$[0]),getstrlen(.@tmp$)-1); set .@oaid, getcharid(3); set .@ip$, replacestr(.@atcmd_parameters$[0], "*", "%"); for(set .@j,0;;set .@j,.@j+1) { deletearray .@aid[0],128; query_sql "SELECT `account_id` FROM `login` WHERE `last_ip` LIKE '"+.@ip$+"' LIMIT "+(.@j*127)+",127",.@aid; set .@num, getarraysize(.@aid); for( set .@i,0; .@i<.@num; set .@i,.@i+1 ) { if( attachrid(.@aid[.@i]) ) { Announce "You have been banned because GM reject IP ["+.@atcmd_parameters$[0]+"]. Reason : "+.@reason$,bc_self; addtimer 1000,strnpcinfo(0)+"::OnKick"; detachrid; } } if( .@num < 127 ) break; } attachrid .@oaid; query_sql "SELECT `ban_id` FROM `ipbanlist2` WHERE `list` = '"+.@atcmd_parameters$[0]+"'",.@c; if( .@c ) { query_sql "UPDATE `ipbanlist2` SET `status` = 1 WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; query_sql "UPDATE `ipbanlist2` SET `ban_id` = "+getcharid(3)+" WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; query_sql "UPDATE `ipbanlist2` SET `ban_reason` = '"+.@reason$+"' WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; } else query_sql "INSERT `ipbanlist2` VALUES('"+.@atcmd_parameters$[0]+"','"+.@reason$+"','',1,"+.@oaid+",0)"; message strcharinfo(0),"Ban IP:"+.@atcmd_parameters$[0]; end; OnUnBan: if ( !.@atcmd_numparameters ) { message strcharinfo(0), "usage: @unbanip <ip> <reason>"; end; } set .@atcmd_parameters$[0],escape_sql(.@atcmd_parameters$[0]); set .@atcmd_parameters$[1],escape_sql(.@atcmd_parameters$[1]); query_sql "UPDATE `ipbanlist2` SET `status` = 0 WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; query_sql "UPDATE `ipbanlist2` SET `unban_id` = "+getcharid(3)+" WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; query_sql "UPDATE `ipbanlist2` SET `unban_reason` = '"+.@atcmd_parameters$[1]+"' WHERE `list` = '"+.@atcmd_parameters$[0]+"'"; message strcharinfo(0),"Unban IP:"+.@atcmd_parameters$[0]; end; OnPCLoginEvent: query_sql "SELECT `last_ip` FROM `login` WHERE `account_id` = "+getcharid(3),.@ip$; set .@ip$, .@ip$[0]; deletearray .@my_array$[0],128; explode(.@my_array$, .@ip$, "."); setarray .@my_array1$[0],.@my_array$[0],.@my_array$[1],.@my_array$[2],"*"; setarray .@my_array2$[0],.@my_array$[0],.@my_array$[1],"*","*"; setarray .@my_array3$[0],.@my_array$[0],"*","*","*"; setarray .@my_array4$[0],"*","*","*","*"; set .@my_array1$,implode(.@my_array1$, "."); set .@my_array2$,implode(.@my_array2$, "."); set .@my_array3$,implode(.@my_array3$, "."); set .@my_array4$,implode(.@my_array4$, "."); query_sql "SELECT `list`,`ban_reason` FROM `ipbanlist2` WHERE `list` = '"+.@ip$+"' OR `list` = '"+.@my_array1$+"' OR `list` = '"+.@my_array2$+"' OR `list` = '"+.@my_array3$+"' OR `list` = '"+.@my_array4$+"' ",.@list$,.@ban_reason$; set .@num, getarraysize(.@list$); if( .@num ) { Announce "You have been banned because GM reject IP ["+.@list$[0]+"]. Reason : "+.@ban_reason$[0],bc_self; addtimer 5000,strnpcinfo(0)+"::OnKick"; } end; OnKick: atcommand "@kick "+strcharinfo(0); end; } i got error im using EA not RA and HER Quote
Hiryu Imajin Posted July 31, 2013 Posted July 31, 2013 I was told by Lionhardt that the bindatcmd is only for rAthena. I'm receiving the same kind of error and im using 3Ceam. Quote
Question
youtube
guys how can i ask @commands like @banip to ban IP with time example
your account has bee
im using EA
Edited by youtube
3 answers to this question
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.