RustyPeanuts98

Untitled

Oct 10th, 2014
1,488
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.86 KB | None | 0 0
  1. # - Skript by RastaNinja_/RustyPeanuts98 - #
  2.  
  3. options:
  4. P: &8&l[&cModa&8&l]&f
  5. HC: &c
  6. CC: &f
  7. #messages:
  8. firstkickmsg: You have been banned temporarily! #message when user is first kicked
  9. joinkickmsg: You have been banned for %{time.%player%}%! #message everytime user attempts to relog during tempban
  10. banmsg: You have been banned! #ban message
  11. #permissions:
  12. tempperm: skript.tempban #permission for /tempban and /untempban
  13. banperm: skript.permban #permission for /ban and /unban
  14.  
  15. # - Bans - #
  16.  
  17. command /ban <offlineplayer> [<text>]:
  18. permission: {@banperm}
  19. usage: /ban [player] [<reasoning>]
  20. trigger:
  21. if arg 1 is banned:
  22. message "{@P} This player is already banned!"
  23. stop
  24. if arg 1 is not banned:
  25. kick arg 1 due to "{@CC}{@banmsg} for: {@HC}%arg 2%"
  26. ban arg 1
  27. message "{@P} You have banned {@HC}%arg 1%!"
  28. loop all players:
  29. loop-player is op:
  30. message "{@P} {@CC}%command sender% banned {@HC}%arg 1% {@CC}for {@HC}%arg 2%!" to the loop-player
  31.  
  32. command /unban <offlineplayer>:
  33. permission: {@banperm}
  34. aliases: /pardon, /unb
  35. usage: /unban [player]
  36. trigger:
  37. if arg 1 is banned:
  38. unban arg 1
  39. message "{@P}The ban for {@HC}%arg 1% {@CC}has been lifted!"
  40. loop all players:
  41. loop-player is op:
  42. message "{@P} {@CC}%command sender% has lifted the ban for {@HC}%arg 1%!" to the loop-player
  43. stop
  44. else:
  45. message "{@P} This player is NOT banned!"
  46.  
  47.  
  48. # - Temp bans - #
  49.  
  50. #the timespan for example is 1 minute, 3 hours, or 52 days...etc
  51. command /tempban <offlineplayer> <timespan>:
  52. permission: {@tempperm}
  53. aliases: /tban, /tempb
  54. usage: /tempban [player] [timespan]
  55. trigger:
  56. set {kickmsg.%arg 1%} to true
  57. set {time.%arg 1%} to arg 2
  58. kick the arg 1 due to "{@firstkickmsg}"
  59. set {ban.%arg 1%} to now
  60. loop all players:
  61. loop-player is op:
  62. message "{@P} {@CC}%command sender% has temp-banned {@HC}%arg 1% {@CC}for {@HC}%arg 2%!" to the loop-player
  63.  
  64.  
  65. command /untempban <offlineplayer>:
  66. permission: {@tempperm}
  67. aliases: /untemp, untb
  68. usage: /untempban [player]
  69. trigger:
  70. if {kickmsg.arg 1} is true:
  71. set {time.%arg 1%} to now
  72. message "{@P}The temp-ban for {@HC}%arg 1% {@CC}has been lifted!"
  73. loop all players:
  74. loop-player is op:
  75. message "{@P} {@CC}%command sender% has lifted the ban for {@HC}%arg 1%!" to the loop-player
  76. set {kickmsg.%arg 1%} to false
  77. else:
  78. message "{@P}This player is NOT banned!"
  79.  
  80. # - Events for logging in/out when temp-banned - #
  81.  
  82. on join:
  83. if difference between {ban.%player%} and now is less than {time.%player%}:
  84. set join message to ""
  85. set {kickmsg.%player%} to true
  86. wait 1 tick
  87. kick the player due to "{@joinkickmsg}"
  88. else:
  89. set {kickmsg.%player%} to false
  90.  
  91. on disconnect:
  92. if {kickmsg.%player%} is true:
  93. set leave message to ""
Advertisement
Add Comment
Please, Sign In to add comment