on skript load: if file "plugins/ChatManager" doesn't exist: create file "plugins/ChatManager" wait 25 tick if file "plugins/ChatManager/config.yml" doesn't exist: create file "plugins/ChatManager/config.yml" wait 50 tick if file "plugins/ChatManager/players" doesn't exist: create file "plugins/ChatManager/players" wait 75 tick if file "plugins/ChatManager/state.yml" doesn't exist: create file "plugins/ChatManager/state.yml" #function useChat(p: player, t: text): #W budowie! on join: if file "plugins/ChatManager/players/%player%.yml" doesn't exist: create file "plugins/ChatManager/players/%player%.yml" stop if file "plugins/ChatManager/players/%player%.yml" exist: stop on chat: if yaml value "Chat" is "true" from "plugins/ChatManager/state.yml": stop if yaml value "Chat" is "false" from "plugins/ChatManager/state.yml": if player doesn't have permission "chat.write": cancel event send "&8» &6Chat jest wyłączony!" to player stop if player has permission "chat.write": stop if yaml value "Chat" is "clear" from "plugins/ChatManager/state.yml": cancel event send "&8» &6Chat jest czyszczony!" to player stop if yaml value "Chat" is "vip" from "plugins/ChatManager/state.yml": if player doesn't have permission "chat.write.vip" or "chat.write": cancel event send "&8» &6Chat jest wyłącznie dla VIP i Administratorów!" to player stop if player has permission "chat.write.vip" or "chat.write": stop command /chat [] []: trigger: if player doesn't have permission "chat.use": cancel event send "&8» &6Nie masz permisji!" stop if player has permission "chat.use": if arg 1 is not set: if yaml value "Command" is "false" from "plugins/ChatManager/players/%player%.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla ciebie." to player stop if yaml value "Command" is "false" from "plugins/ChatManager/config.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla wszystkich." to player stop if yaml value "Command" is "true" from "plugins/ChatManager/config.yml": if yaml value "Command" is "true" from "plugins/ChatManager/players/%player%.yml": useChat(player, "gui") if arg 1 is "on": if yaml value "Command" is "false" from "plugins/ChatManager/players/%player%.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla ciebie." to player stop if yaml value "Command" is "false" from "plugins/ChatManager/config.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla wszystkich." to player if yaml value "Command" is "true" from "plugins/ChatManager/config.yml": if yaml value "Command" is "true" from "plugins/ChatManager/players/%player%.yml": if yaml value "Chat" is "false" from "plugins/ChatManager/state.yml": useChat(player, "on") stop if yaml value "Chat" is "true" from "plugins/ChatManager/state.yml": cancel event send "&8» &6Chat już jest włączony!" to player stop if arg 1 is "off": if yaml value "Command" is "false" from "plugins/ChatManager/players/%player%.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla ciebie." to player stop if yaml value "Command" is "false" from "plugins/ChatManager/config.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla wszystkich." to player if yaml value "Command" is "true" from "plugins/ChatManager/config.yml": if yaml value "Command" is "true" from "plugins/ChatManager/players/%player%.yml": if yaml value "Chat" is "true" from "plugins/ChatManager/state.yml": useChat(player, "off") stop if yaml value "Chat" is "false" from "plugins/ChatManager/state.yml": cancel event send "&8» &6Chat już jest wyłączony!" to player stop if arg 1 is "clear": if yaml value "Command" is "false" from "plugins/ChatManager/players/%player%.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla ciebie." to player stop if yaml value "Command" is "false" from "plugins/ChatManager/config.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla wszystkich." to player if yaml value "Command" is "true" from "plugins/ChatManager/config.yml": if yaml value "Command" is "true" from "plugins/ChatManager/players/%player%.yml": useChat(player, "clear") if arg 1 is "vip": if yaml value "Command" is "false" from "plugins/ChatManager/players/%player%.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla ciebie." to player stop if yaml value "Command" is "false" from "plugins/ChatManager/config.yml": cancel event send "&8» &6Nie możesz użyć tej komendy, ze względu że jest wyłączona dla wszystkich." to player if yaml value "Command" is "true" from "plugins/ChatManager/config.yml": if yaml value "Command" is "true" from "plugins/ChatManager/players/%player%.yml": if yaml value "Chat-VIP" is "true" from "plugins/ChatManager/state.yml": useChat(player, "vip-off") stop if yaml value "Chat-VIP" is "false" from "plugins/ChatManager/state.yml": useChat(player, "vip-on") stop