Skocz do zawartości
  • 0

on command


foxeik

Pytanie

Witam mam taki problem chce sb np zrobic komende na deszcz, slonce, dzien i noc w jednym ciągu sposobem "on command" kod wyglada tak:

on command:
    if player has permission "moderator":
        if command is "day":
            set time in player's world to 06:00
            send "&6Ustawiles dzien w swoim swiecie!"
            stop
        if command is "night":
            set time in player's world to 22:00
            send "&6Ustawiles noc w swoim swiecie!"
            stop
        if command is "sun":
            set weather in player's world to sun
            send "&6Ustawiles bezchmurna pogode w swoim swiecie!"
            stop
        if command is "rain":
            set weather in player's world to rain
            send "&6Ustawiles deszcz w swoim swiecie!"
            stop

 

Po wpisaniu komenda normalnie działa jednak wysyła mi najpierw "Ustawiles dzien w swoim świecie" a potem "Unkown command. Type "/help" for help."

Jakis pomysł aby nie wyswietłało tego drugiego?

Odnośnik do komentarza
https://skript.pl/temat/16563-on-command/
Udostępnij na innych stronach

16 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
4 minuty temu, foxeik napisał:

@Xar0PL ja nie wiem czy to tak ciężko zrozumieć... chodzi mi o /day, /night a nie /pogoda day/night... zrobię sb to szybciej w pluginie juz chyba

 

to w czym problem napisać:

??

https://code.skript.pl/ugoiJpnz/

Odnośnik do komentarza
https://skript.pl/temat/16563-on-command/#findComment-113226
Udostępnij na innych stronach

  • 0

Nie rozumiecie w ogóle autora tematu...

Skrypt dobrze napisałeś ale zapomniałeś o jednej specyficznej funkcji: cancel event

Proszę:

on command:
	if player has permission "moderator":
		if command is "day":
			cancel event
			set time in player's world to 06:00
			send "&6Ustawiles dzien w swoim swiecie!"
			stop
		if command is "night":
			cancel event
			set time in player's world to 22:00
			send "&6Ustawiles noc w swoim swiecie!"
			stop
		if command is "sun":
			cancel event
			set weather in player's world to sun
			send "&6Ustawiles bezchmurna pogode w swoim swiecie!"
			stop
		if command is "rain":
			cancel event
			set weather in player's world to rain
			send "&6Ustawiles deszcz w swoim swiecie!"
			stop	

 

Odnośnik do komentarza
https://skript.pl/temat/16563-on-command/#findComment-113444
Udostępnij na innych stronach

Nieaktywny
Ten temat został zamknięty. Brak możliwości dodania odpowiedzi.
×
×
  • Dodaj nową pozycję...