Advertisement
papastudio

Ban IP

Aug 3rd, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. //===== Custom Script ======================================================================
  2. //= Ban U
  3. //===== By: =================================================================================
  4. //= playgron
  5. //===== Current Version: ====================================================================
  6. //= 1.2
  7. //===== Compatible With: ====================================================================
  8. //= Any Cuustom Version
  9. //===== Description: ========================================================================
  10. //= Ban ip people
  11. //= 1 Click ban ip
  12. //===== Additional Comments: ================================================================
  13. //= Updates
  14. //Version 1.2 : Added 1 click ban ip
  15. //
  16. //===========================================================================================
  17. //Ban U
  18.  
  19. prontera,50,50,0 script BAN ID 910,{
  20. if (getgmlevel()<60) end;
  21.  
  22. switch(select("Ban by char name:Ban by login ID")) {
  23. case 1:
  24. mes "Enter the char's name:";
  25. input .@name$;
  26. query_sql "SELECT `char_id`,`account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'", .@char_id,.@account_id,.@name$;
  27. if (!.@account_id) {
  28. mes "^FF0000 Char name does not exist.";
  29. close;
  30.  
  31. }
  32.  
  33. break;
  34. case 2:
  35. mes "Enter the login ID:";
  36. input .@userid$;
  37. query_sql "SELECT `account_id`,`userid` FROM `login` WHERE `userid` = '"+escape_sql(.@userid$)+"'", .@account_id,.@userid$;
  38. if (!.@account_id) {
  39. mes "^FF0000 Login ID does not exist.";
  40. close;
  41.  
  42. }
  43.  
  44. break;
  45.  
  46. }
  47.  
  48. query_sql "SELECT `last_ip` FROM `login` WHERE `account_id`="+.@account_id, .@last_ip$;
  49. mes "Enter the reason for ban:";
  50. input .@reason$;
  51. next;
  52.  
  53. if (.@char_id) mes "Ban the character ^FF0000" + .@name$ + "^000000 ?";
  54. else mes "Ban the login ID ^FF0000" + .@userid$ + "^000000 ?";
  55. mes "IP =^0000FF " + .@last_ip$ + "^000000";
  56. mes "Reason =^0000FF " + .@reason$ + "^000000";
  57. mes " ";
  58. if(select("No:Yes, ban the IP")==1) close;
  59.  
  60. if (.@char_id) atcommand "@block "+.@name$;
  61. else query_sql "UPDATE `login` SET `state`=5 WHERE `account_id`="+.@account_id;
  62. query_sql "INSERT INTO `ipbanlist`(`list`,`btime`,`rtime`,`reason`) VALUES('"+.@last_ip$+"',NOW(),'2099-12-31 00:00:00','("+.@name$+.@userid$+") "+.@reason$+"')";
  63.  
  64. mes "Ban entered successfully!";
  65. close;
  66.  
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement