Slupik98

YourChat

Aug 12th, 2014
389
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.77 KB | None | 0 0
  1. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  2. command /YourChat [<text>] [<text>] [<text>]:
  3. aliases: yc, chat
  4. trigger:
  5. if arg 1 is "r" or "reload":
  6. if player have permissions "YourChat.*":
  7. execute player command "skript reload %script%"
  8. else:
  9. send "&4Nie masz do tego praw"
  10. if arg 1 is "re" or "reset":
  11. if player have permissions "YourChat.*":
  12. if folder "plugins/Skript/scripts/YourChat/config.yml" doesn't exists:
  13. create folder "plugins/Skript/scripts/YourChat/config.yml"
  14. create file "plugins/Skript/scripts/YourChat/config.yml"
  15. wf "Rangi:" "plugins/Skript/scripts/YourChat/config.yml"
  16. wf " HQ:" "plugins/Skript/scripts/YourChat/config.yml"
  17. wf " format: '&b&l[^kasa^] &8[&4&lHQ&8] ^MyLVL^ &4^nick^&8&l>> &c^message^'" "plugins/Skript/scripts/YourChat/config.yml"
  18. wf " Helper:" "plugins/Skript/scripts/YourChat/config.yml"
  19. wf " format: '&b&l[^kasa^] &8[&4&lHelper&8] ^MyLVL^ &4^nick^&8&l>> &c^message^'" "plugins/Skript/scripts/YourChat/config.yml"
  20. else:
  21. if file "plugins/Skript/scripts/YourChat/config.yml" doesn't exists:
  22. create file "plugins/Skript/scripts/YourChat/config.yml"
  23. wf "Rangi:" "plugins/Skript/scripts/YourChat/config.yml"
  24. wf " HQ:" "plugins/Skript/scripts/YourChat/config.yml"
  25. wf " format: '&b&l[^kasa^] &8[&4&lHQ&8] ^MyLVL^ &4^nick^&8&l>> &c^message^'" "plugins/Skript/scripts/YourChat/config.yml"
  26. wf " Helper:" "plugins/Skript/scripts/YourChat/config.yml"
  27. wf " format: '&b&l[^kasa^] &8[&4&lHelper&8] ^MyLVL^ &4^nick^&8&l>> &c^message^'" "plugins/Skript/scripts/YourChat/config.yml"
  28. else:
  29. delete {YourChat::gracz::*}
  30. clear {YourChat::rangi::lista::*}
  31. set {_rangi::*} to configuration section "Rangi" get of "plugins/Skript/scripts/YourChat/config.yml"
  32. set {_rangiGraczy::*} to configuration section "users" get of "plugins/PermissionsEx/permissions.yml"
  33. loop {_rangiGraczy::*}:
  34. set {_ranga::*} to value list "users.%loop-value%.group" get of "plugins/PermissionsEx/permissions.yml"
  35. set {YourChat::gracz::%loop-value%::ranga} to {_ranga::1}
  36. loop {_rangi::*}:
  37. set {_ranga} to loop-value
  38. add {_ranga} to {YourChat::rangi::lista::*}
  39. set {YourChat::ranga::%{_ranga}%::format} to coloured single value "Rangi.%{_ranga}%.format" get of "plugins/Skript/scripts/YourChat/config.yml"
  40. if {YourChat::ranga::%{_ranga}%::format} is not set:
  41. set {YourChat::ranga::%{_ranga}%::format} to coloured single value "Rangi.deafult.format" get of "plugins/Skript/scripts/YourChat/config.yml"
  42. send "Pomyślnie zresetowano YourChat"
  43. else:
  44. send "&4Nie masz do tego praw"
  45. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  46. on load:
  47. execute console command "YourChat reset"
  48. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  49. on first join:
  50. execute console command "pex user %player% group set gracz"
  51. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  52. on chat:
  53. cancel event
  54. set {_ranga} to {YourChat::gracz::%player%::ranga}
  55. set {_mess} to {YourChat::ranga::%{_ranga}%::format}
  56. replace all "^kasa^" with "%{mineroxy.%player%}%" in {_mess}
  57. replace all "^nick^" with "%player%" in {_mess}
  58. replace all "^kolorowa ranga^" or "^ranga^" with "%{YourChat::ranga::%{_ranga}%::kolor}%" in {_mess}
  59. replace all "^message^" with "%message%" in {_mess}
  60. replace all "^Stopien^" with "%{YourChat::gracz::%player%::ranga}%" in {_mess}
  61. replace all "^MyLVL^" with "%{MyLVL::gracz::%player%::lvl}%" in {_mess}
  62. if player do not have permissions "YourChat.kolory" or "YourChat.*":
  63. replace all "&" with "" in {_mess}
  64. if player have permissions "YourChat.kolory" or "YourChat.*":
  65. set {_mess} to coloured {_mess}
  66. broadcast "%{_mess}%"
  67. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  68. on join:
  69. if {YourChat::gracz::%player%::ranga} is not set:
  70. set {YourChat::gracz::%player%::ranga} to "{@YourChat.default.ranga}"
  71. #////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  72. on command:
  73. set {_command.all} to "%command% %arguments%"
  74. set {_command::*} to {_command.all} split at " "
  75. loop {_command::*}:
  76. add loop-value to {_argumenty::*}
  77. if {_argumenty::1} is "pex":
  78. if {_argumenty::2} is "user":
  79. if {_argumenty::4} is "group":
  80. if {_argumenty::5} is "set":
  81. set {YourChat::gracz::%{_argumenty::3}%::ranga} to "%{_argumenty::6}%"
Advertisement
Add Comment
Please, Sign In to add comment