Skocz do zawartości
  • 0

YML


LordziaK

Pytanie

Mam taki kod:

Spoiler

command /on:
    trigger:
        set {_onchat} to value list "config.message.on" get of "plugins/LChat/config.yml"
        wait 2 ticks
        broadcast "%{_onchat}%"
command /off:
    trigger:
        set {_offchat} to value list "config.message.off" get of "plugins/LChat/config.yml"
        wait 2 ticks
        broadcast "%{_offchat}%"
command /clearr:
    trigger:
        set {_clear} to value list "config.message.clear" get of "plugins/LChat/config.yml"
        wait 2 ticks
        broadcast "%{_clear}%"

on script load:
    if file "plugins/LChat/config.yml" doesn't exists:
        create file "plugins/LChat/config.yml"

i taki plik YML:

Spoiler

#Chat by LordziaK

config:
  message:
    off:
      - 'Chat zostal wylaczony'
    on:
      - 'Chat zostal wlaczony'
    clear:
      - 'Chat zostal wyczyszczony'
    no-perm:
      - 'Nie masz permissi do chatu'

gdy pisze /off lub /on to pisze <none> ;/ a jak /clearr to dziala dobrze...

pomoze ktos? :D

Odnośnik do komentarza
https://skript.pl/temat/11471-yml/
Udostępnij na innych stronach

6 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0

Jak się nigdzie nie walnąłem to będzie działać:

options:
	dir: plugins/chat/
	
on load:
	if file "{@dir} doesn't exists
		create folder "{@dir}"
	if file "{@dir}/config.yml" doesn't exists:
		create file "{@dir}/config.yml"
		set "message.on" to "Chat zostal wlaczony" in yaml file "{@dir}/config.yml"
		set "message.off" to "Chat zostal wylaczony" in yaml file "{@dir}/config.yml"
		set "message.clear" to "Chat zostal wyczyszczony" in yaml file "{@dir}/config.yml"
	set {chat::msg::on} to coloured single value "message.on" get of "{@dir}/config.yml"
	set {chat::msg::off} to coloured single value "message.off" get of "{@dir}/config.yml"
	set {chat::msg::clear} to coloured single value "message.clear" get of "{@dir}/config.yml"
	
variables:
	{chat::on} = true
	
command /chat [<text="help">]:
	permission: chat.admin
	trigger:
		if arg 1 is "help" or "pomoc":
			send "---===Chat===---"
			send "/chat on"
			send "/chat off"
			send "/chat clear"
			send "---===Chat===---"
		if arg 1 is "on" or "wl":
			set {chat::on} to true
			send "Wlaczyles czat"
			broadcas "{chat::msg::on}"
			stop
		if arg 1 is "off" or "wyl":
			set {chat::on} to false
			send "Wlaczyles czat"
			broadcas "{chat::msg::off}"
			stop
		if arg 1 is "clear" or "czysc":
			loop 128 times:
				broadcas ""
			broadcas "{chat::msg::clear}"
			stop
		else:
			execute me command "chat help"
			stop
			
on chat:
	if {chat::on} is false:
		if player has permission "chat.admin":
			send "Czat jest off"
			stop
		else:
			cancel event
			send "{chat::msg::off}"
			stop

Wymaga pluginu WildSkript 

Odnośnik do komentarza
https://skript.pl/temat/11471-yml/#findComment-82792
Udostępnij na innych stronach

  • 0
7 godzin temu, ShroN napisał:

Jak się nigdzie nie walnąłem to będzie działać:


options:
	dir: plugins/chat/
	
on load:
	if file "{@dir} doesn't exists
		create folder "{@dir}"
	if file "{@dir}/config.yml" doesn't exists:
		create file "{@dir}/config.yml"
		set "message.on" to "Chat zostal wlaczony" in yaml file "{@dir}/config.yml"
		set "message.off" to "Chat zostal wylaczony" in yaml file "{@dir}/config.yml"
		set "message.clear" to "Chat zostal wyczyszczony" in yaml file "{@dir}/config.yml"
	set {chat::msg::on} to coloured single value "message.on" get of "{@dir}/config.yml"
	set {chat::msg::off} to coloured single value "message.off" get of "{@dir}/config.yml"
	set {chat::msg::clear} to coloured single value "message.clear" get of "{@dir}/config.yml"
	
variables:
	{chat::on} = true
	
command /chat [<text="help">]:
	permission: chat.admin
	trigger:
		if arg 1 is "help" or "pomoc":
			send "---===Chat===---"
			send "/chat on"
			send "/chat off"
			send "/chat clear"
			send "---===Chat===---"
		if arg 1 is "on" or "wl":
			set {chat::on} to true
			send "Wlaczyles czat"
			broadcas "{chat::msg::on}"
			stop
		if arg 1 is "off" or "wyl":
			set {chat::on} to false
			send "Wlaczyles czat"
			broadcas "{chat::msg::off}"
			stop
		if arg 1 is "clear" or "czysc":
			loop 128 times:
				broadcas ""
			broadcas "{chat::msg::clear}"
			stop
		else:
			execute me command "chat help"
			stop
			
on chat:
	if {chat::on} is false:
		if player has permission "chat.admin":
			send "Czat jest off"
			stop
		else:
			cancel event
			send "{chat::msg::off}"
			stop

Wymaga pluginu WildSkript 

Nie dziala ;/ Czyscy czat i pisze {chat::msg:off} i jak dodam w pliku chat Jakis kolor bendzie dzialalo?

Odnośnik do komentarza
https://skript.pl/temat/11471-yml/#findComment-82839
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...