Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== Custom Script ======================================================================
- //= Ban U
- //===== By: =================================================================================
- //= playgron
- //===== Current Version: ====================================================================
- //= 1.2
- //===== Compatible With: ====================================================================
- //= Any Cuustom Version
- //===== Description: ========================================================================
- //= Ban ip people
- //= 1 Click ban ip
- //===== Additional Comments: ================================================================
- //= Updates
- //Version 1.2 : Added 1 click ban ip
- //
- //===========================================================================================
- //Ban U
- prontera,50,50,0 script BAN ID 910,{
- if (getgmlevel()<60) end;
- switch(select("Ban by char name:Ban by login ID")) {
- case 1:
- mes "Enter the char's name:";
- input .@name$;
- query_sql "SELECT `char_id`,`account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'", .@char_id,.@account_id,.@name$;
- if (!.@account_id) {
- mes "^FF0000 Char name does not exist.";
- close;
- }
- break;
- case 2:
- mes "Enter the login ID:";
- input .@userid$;
- query_sql "SELECT `account_id`,`userid` FROM `login` WHERE `userid` = '"+escape_sql(.@userid$)+"'", .@account_id,.@userid$;
- if (!.@account_id) {
- mes "^FF0000 Login ID does not exist.";
- close;
- }
- break;
- }
- query_sql "SELECT `last_ip` FROM `login` WHERE `account_id`="+.@account_id, .@last_ip$;
- mes "Enter the reason for ban:";
- input .@reason$;
- next;
- if (.@char_id) mes "Ban the character ^FF0000" + .@name$ + "^000000 ?";
- else mes "Ban the login ID ^FF0000" + .@userid$ + "^000000 ?";
- mes "IP =^0000FF " + .@last_ip$ + "^000000";
- mes "Reason =^0000FF " + .@reason$ + "^000000";
- mes " ";
- if(select("No:Yes, ban the IP")==1) close;
- if (.@char_id) atcommand "@block "+.@name$;
- else query_sql "UPDATE `login` SET `state`=5 WHERE `account_id`="+.@account_id;
- query_sql "INSERT INTO `ipbanlist`(`list`,`btime`,`rtime`,`reason`) VALUES('"+.@last_ip$+"',NOW(),'2099-12-31 00:00:00','("+.@name$+.@userid$+") "+.@reason$+"')";
- mes "Ban entered successfully!";
- close;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement