Skocz do zawartości

Dołącz do społeczności!

👋 Witaj na MPCForum!

Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

  • ✅ Pełny dostęp do działów i ukrytych treści
  • ✅ Możliwość pisania i odpowiadania w tematach
  • ✅ System prywatnych wiadomości
  • ✅ Zbieranie reputacji i rozwijanie swojego profilu
  • ✅ Członkostwo w jednej z największych społeczności graczy

👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

Zarejestruj się teraz

[Problem] Skrypt na miasta.

Rekomendowane odpowiedzi

Opublikowano

POMÓŻCIE!

options:
	p1: 64 diamond
	p2: 64 emerald
	p3: 32 bookshelf
	p4: 16 ender pearl
	p5: 10 321:1
command /miasto [<text>] [<text>] [<text>]:
		trigger:
				if arg 1 is not set:
						send "&a/miasto zaloz - zakladasz miasto"
						send "&a/miasto usun - usuwasz miasto"
						send "&a/miasto sprzedaj - sprzedajesz miasto"
						send "&a/miasto dodaj - dodajesz obywatela"
						send "&a/miasto wyrzuc - wyrzucasz obywatela"
						send "&a/miasto opusc - opuszczasz miasto"
						send "&a/miasto przedmioty - lista przedmiotow do zalozenia miasta"
						if player is op:
								send "&a/miasto zaloz - zakladasz miasto"
								send "&a/miasto usun - usuwasz miasto"
								send "&a/miasto sprzedaj - sprzedajesz miasto"
								send "&a/miasto dodaj - dodajesz obywatela"
								send "&a/miasto wyrzuc - wyrzucasz obywatela"
								send "&a/miasto opusc - opuszczasz miasto"
								send "&a/miasto przedmioty - lista przedmiotow do zalozenia miasta"
								send "&c-------------------------------------"
								send "&a/miasto przeladuj"
				if arg 1 is "przeladuj":
						send "&6Trwa przeladowanie HardCity..."
						wait 1 second
						execute console command "sk reload miasta"
						broadcast "&ePrzeladowano HardCity!"
				if arg 1 is "przedmioty":
						send "&b64 diamenty"
						send "&b64 emeraldy"
						send "&b32 bookshelfy"
						send "&b16 enderperel"
						send "&b10 zlotych jablek *kox*"
				if arg 1 is "zaloz":
						send "&cPodaj nazwe miasta i jego tag."
						if arg 2 is set:
								if arg 3 is set:
		else:
				send "&aWpisz tag miasta oraz nazwe."
										set {tag.%player%} to arg 3
										send "&6Trwa tworzenie miasta!"
										wait 1 second
										execute console command "//pos1"
										execute console command "//pos2"
										execute console command "//expand 80 n"
										execute console command "//expand 80 s"
										execute console command "//expand 80 w"
										execute console command "//expand 80 e"
										execute console command "//expand vert"
										execute console command "rg define %name of player% %name of player%"
										send "&aStworzyles miasto o nazwie %argument-2% i o tagu %argument-3%!"
                                        set the player's display name to "&6[&c%{tag.%player%}%&6]&7 %name of player%"
                                        set the player's tablist name to "&c[%{tag.%player%}%]%name of player%"
										broadcast "&eGracz %player% stworzyl miasto o nazwie &6%argument-2%&e i o tagu&6 %argument-3%&6!"
				else:
						send "&cNie mozesz zalozyc miasta po raz drugi, lecz mozesz usunac to miasto i zalozyc nowe."
				if arg 1 is "usun":
						send "&aUsunales swoje miasto!"
						execute console command "rg remove %name of player%"
else:
		send "&cNie masz miasta i nie mozesz go usunac!"
				if arg 1 is "sprzedaj":
						if arg 2 is "%name of player%":
								send "&7Wyslales propozycje sprzedazy do gracza o nicku &a%argument-2%"
								send "&7Dostales propozycje kupna miasta od gracza &a%player%&7, aby zaakceptowac wpisz /miasto kup, jezeli nie chcesz kupic wpisz /miasto nie" to argument-2 
								if arg 1 is "kup":
										send "&7Kupiles miasto od gracza o nicku &a%loop-player%"
										send "&7Gracz &a%player%&7 odkupil od ciebie miasto." to loop-player 
										execute console command "rg addowner %player% %loop-player%"
				else:
						send "&cNie masz propozycji o kupno miasta!"
								if arg 1 is "nie":
										send "&7Odrzuciles propozycje kupna miasta."
										send "&7Gracz &a%player%&7 odrzucil twoja propozycje sprzedarzy." to loop-player
				else:
						send "&cNie masz propozycji kupna aby odmowic!"
								if arg 1 is "dodaj":
										if arg 2 is "%name of player%":
												send "&7Wyslales zaproszenie do miasta graczowi o nicku &a%argument-2%&7!"
												send "&7Dostales zaproszenie do miasta od gracza o nicku &a%player%&7! Aby zaakceptowac wpisz /miasto dolacz, aby odrzucic wpisz /miasto odrzuc" to argument-2
												if arg 1 is "dolacz":
														send "&7Dolaczyles do miasta gracza &a%loop-player%&7!"
														send "&7Gracz &a%player%&7 zaakceptowal zaproszenie o dodanie go do twojego miasta!" to loop-player
														execute console command "rg addmember %player% %loop-player%"
														if arg 1 is "odrzuc":
																send "&7Odrzuciles zaproszenie!"
																send "&7Gracz &a%player%&7 odrzucil twoje zaproszenie!"
																if arg 1 is "wyrzuc":
																		if arg 2 is "%name of player%":
																				send "&7Wyrzuciles gracza o nicku &a%loop-player%"
																				execute console command "rg removemember %loop-player% %player%"
																				send "&7Zostales wyrzucony z miasta! &aUciekaj&7!"
																if arg 1 is "opusc":
																		send "&7Opusciles miasto gracza &a%loop-player%"
																		execute console command "rg removemember %player% %loop-player%"
Opublikowano

W tym skrypcie jest tyle błędów że nie warto go poprawiać. Wyglada to tak jakby to był urywek jakiegoś skryptu. W kodzie dodana jest funkcja loop-player która nawet nie jest zdefiniowana. 

Opublikowano

@szymo02 Tabowanie nic tu nie da. Sam próbowałem, ale poskutkowało to kolejną porcją błędów. 

Opublikowano

Trzeba by napisać to od nowa. Za dużo błędów, po prostu krok po kroku przepisać trzeba i sprawdzać co chwile ewentualne błędy: "Mały błąd na początku jest wielkim błędem na końcu"

To wygląda jak sygnatura!

Opublikowano
  • Autor

@Edit
Zrobiłem cos takiego:

 

#Ustawienia

options:
	i1: 64 diamond
	i2: 64 bookshelf
	i3: 32 321:1
	i4: 32 emerald
	i5: 10 coal
	teren: 64
	
#Kod skryptu

#Komenda wykonujaca

command /miasto [<text>] [<text>] [<offlineplayer>, <text>]:
	trigger:
		if arg 1 is not set:
			send "&7Poprawne uzycie &a/miasto pomoc"
		if arg 1 is "pomoc":
			send "&7---*-----*&a-&7*-----*---"
			send "&a/miasto zaloz &c-&a zakladasz miasto"
			send "&a/miasto usun &c-&a usuwasz miasto"
			send "&a/miasto sprzedaj &c-&a sprzedajesz miasto"
			send "&a/miasto dodaj &c-&a dodajesz obywatela"
			send "&a/miasto wyrzuc &c-&a wyrzucasz obywatela"
			send "&a/miasto odejdz &c&a odchodzisz z miasta"
		
			#Ciag dalszy (i trudniejszy)
	
		if arg 1 is "zaloz":
			send "&7Wpisz nazwe miasta &a(np.Gotha)"
				if arg 2 is set:
					if player has {@i1}:
						if player has {@i2}:
							if player has {@i3}:
								if player has {@i4}:
									if player has {@i5}:
										send "&7Trwa zakladanie miasta"
										remove {@i1} and {@i2} and {@i3} and {@i4} and {@i5} from player's inventory
										wait 2 second
										make player execute command "//pos1"
										make player execute command "//pos2"
										make player execute command "//expand {@teren} n"
										make player execute command "//expand {@teren} w"
										make player execute command "//expand {@teren} e"
										make player execute command "//expand {@teren} s"
										make player execute command "//expand vert"
										make player execute command "rg define %player% %player%"
										make player execute command "rg flag %player% greeting &7Wchodzisz na teren miasta &a%argument-2%"
										make player execute command "rg flag %player% farewell &7Opuszczasz teren miasta &a%argument-2%"
										send "&7Zalozyles miasto o nazwie&a %argument-2%"
										wait 1 second
										broadcast "&7Gracz o nicku &a%player%&7 zalozyl miasto o nazwie %argument-2%"
									else:
										send "&7Nie masz &c{@i1}"
								else:
									send "&7Nie masz &c{@i2}"
							else:
								send "&7Nie masz &c{@i3}"
						else:
							send "&7Nie masz &c{@i4}"
					else:
						send "&7Nie masz &c{@i5}"
				else:
					send "7Masz juz miasto i nie mozesz miec wiecej!"
			else:
				send "&7Jestes juz w miescie i nie mozesz stworzyc wlasnego!"
		else:
			send "&7Miasto o takiej nazwie juz istnieje, wymysl inna."
		
#Ufff... Udalo sie. Teraz zajmiemy sie ciagiem dalszym juz bez takich opisow, tam jusz nic nie kombinuj!
			
		if arg 1 is "usun":
			send "&7Usunales swoje miasto!"
			make console execute command "pex user %player% add worldguard.*"
			make console execute command "pex user %player% add worldedit.*"
			make player execute command "rg del %argument-2%"
			make console execute command "pex user %player% remove worldguard.*"
			make console execute command "pex user %player% remove worldedit.*"
			wait 1 second
			broadcast "&7Gracz o nicku &a%player%&7 usunal miasto o nazwie %a%argument-2%"
		else:
			send "&7Nie masz miasta, wiec nie mozesz go usuwac."
					
		if arg 1 is "sprzedaj":
			if arg 2 is %argument-offlineplayer%:
				if arg 2 is online:
					send "&7Wyslales propozycje sprzedarzy graczowi o nicku &a%argument-offlineplayer%"
					send "&7Dostales propozycje do kupna miasta od gracza &a%player%&7, aby zaakceptowac wpisz&a /miasto kup&7, jesli nie&a /miasto ignoruj" to argument-2
				else:
					send "&7Nie dostales propozycji kupna!"
		if arg 1 is "kup":
			send "&7Gracz o nicku &a%player%&7 kupil od ciebie miasto. Zaplacil za nie&a 10000$" to loop-player
			make console execute command "pex user %player% add worldguard.*"
			make console execute command "pex user %player% add worldedit.*"
			make player execute command "rg removeowner %loop-player% %loop-player%"
			make player execute command "rg addowner %player% %loop-player%"
			make console execute command "pex user %player% remove worldguard.*"
			make console execute command "pex user %player% remove worldedit.*"
			send "&7Kupiles miasto gracza &a%loop-player%"
		else:
			send "&7Nie masz 10000$, aby odkupic miasto od gracza o nicku&a %loop-player%"
		if arg 1 is "dodaj":
			if arg 2 is not set:
				send "&7Wpisz nick gracza ktorego chcesz dodac!"
				if arg 2 is set:
					send "&7Wyslales prosbe o dodanie do miasta graczowi o nicku&a %argument-2%"
					send "&7Dostales zaproszenie do miasta od gracza o nicku &a%player%&7, aby zaakceptowac wpisz&a /miasto dolacz&7, aby odmowic wpisz &a/miasto odmow"
				else:
					send "&7Nie masz miasta aby dodawac!"
		if arg 1 is "dolacz":
			send "&7Dolaczyles do miasta gracza o nicku &a%loop-player%"
			send "&7Gracz o nicku&a %player%&7 dolaczyl do twojego miasta!" to loop-player
			make console execute command "pex user %player% add worldguard.*"
			make console execute command "pex user %player% add worldedit.*"
			make player execute command "rg addmember %player% %loop-player%"
			make player execute command "rg addowner %player% %loop-player%"
			make console execute command "pex user %player% remove worldguard.*"
			make console execute command "pex user %player% remove worldedit.*"
		else:
			send "&7Nie masz zaproszenia, a bez zaproszenia nie dolaczysz!"
		if arg 1 is "odmow":
		send "&7Odmowiles graczowi&a %loop-player%&7 prosbe o dodanie do miasta"
		send "&7Gracz &a%player%&7 odmowil twojej prosbie" to loop-player
	else:
		send "&7Nie masz zaproszenia do miasta, takze nie mozesz odmowic."
		if arg 1 is "wyrzuc":
			if arg 2 is %argument-offlineplayer%:
				if arg 2 is online:
					send "&7Wyrzuciles z miasta gracza o nicku &a%loop-player%"
					send "&7Gracz o nicku &a%player%&7 wyrzucil cie z miasta.&4 Uciekaj!"
					make console execute command "pex user %player% add worldguard.*"
					make console execute command "pex user %player% add worldedit.*"
					make player execute command "rg removemember %loop-player% %player%"
					make console execute command "pex user %player% remove worldguard.*"
					make console execute command "pex user %player% remove worldedit.*"
				else:
					send "&7Nie masz wlasnego miasta i nie mozesz wyrzucac."
		if arg 1 is "odejdz":
			send "&7Opusciles miasto gracza &a%loop-player%"
			make console execute command "pex user %player% add worldguard.*"
			make console execute command "pex user %player% add worldedit.*"
			make player execute command "rg removemember %player% %loop-player%"
			make console execute command "pex user %player% remove worldguard.*"
			make console execute command "pex user %player% remove worldedit.*"
		else:
			send "&7Nie jestes w zadnym miescie wiec nie mozesz go opuscic."
		if arg 1 is "przeladuj":
			make console execute command "sk reload miasta"
			broadcast "&6Przeladowano plugin HardCity!"
		else:
			send "&cNie masz uprawnien"
Opublikowano
  • Autor

Ojojojoj... 49 błędów nie licząc tych po błędach. Radze sobie założyć serwer na swoim komputerze i na bieżąco sprawdać.

#Ustawienia


options:
	i1: 64 diamond
	i2: 64 emerald
	i3: 64 bookshelf
	i4: 10 blaze rod
	i5: 5 ender pearl
	teren: 64

#Kod skryptu


command /miasto [<text>] [<text>] [<text>, <offlineplayer>]:
		trigger:
				if arg 1 is not set:
						send "&7Poprawne uzycie&a /miasto pomoc"
				if arg 1 is "pomoc":
						send "&a/miasto zaloz &c-&7 zakladasz miasto"
						send "&a/miasto usun &c-&7 usuwasz miasto"
						send "&a/miasto sprzedaj &c-&7 sprzedajesz miasto"
						send "&a/miasto dodaj &c-&7 dodajesz obywateli"
						send "&a/miasto odejdz &c-&7 odchodzisz z miasta"
				if arg 1 is "zaloz":
						if argument-2 is not set:
								send "&7Wpisz nazwe miasta!&a (np.Gotha)"
						if arg 2 is set:
								if player has {@i1}:
										if player has {@i2}:
												if player has {@i3}:
														if player has {@i4}:
																if player has {@i5}:
																		wait 1 second
																		send "&7Trwa zakladanie miasta o nazwie&a %argument-2%"
																		wait 1 second
																		execute console command "pex user %name of player% add worldedit.*"
																		execute console command "pex user %name of player% add worldguard.*"
																		execute player command "//pos1"
																		execute player command "//pos2"
																		execute player command "//expand {@teren} w"
																		execute player command "//expand {@teren} n"
																		execute player command "//expand {@teren} e"
																		execute player command "//expand {@teren} s"
																		execute player command "//expand vert"
																		execute player command "region define %name of player%"
																		execute player command "region flag %name of player% use allow"
																		execute player command "region flag %name of player% build deny"
																		execute player command "region addowner %name of player% %name of player%"
																		execute console command "pex user %name of player% remove worldedit.*"
																		execute console command "pex user %name of player% remove worldguard.*"
																		execute console command "rg flag %name of player% greeting &7Wchodzisz na teren miasta &a%argument-2%"
																		execute console command "rg %name of player% farewell &7Opuszczasz teren miasta &a%argument-2%"
																		loop 100 times:
																				send ""
																		remove {@i5} and {@i4} and {@i3} and {@i2} and {@i1} from player's inventory
																		send "&7Miasto o nazwie&a %argument-2%&7 zostalo zalozone!"
																		wait 2 second
																		broadcast "&7Gracz o nicku&a %player%&7 zalozyl miasto o nazwie&a %argument-2%&7!"
																else:
																		send "&7Nie masz &c{@i5}"
														else:
																send "&7Nie masz &c{@i4}"
												else:
														send "&7Nie masz &c{@i3}"
										else:
												send "&7Nie masz &c{@i2}"
								else:
										send "&7Nie masz &c{@i1}"
				if arg 1 is "usun":
						if arg 2 is not set:
								send "&7Nie wpisales nazwy miasta!"
						if arg 2 is set:
								send "&7Trwa usuwanie miasta..."
								wait 1 second
								execute console command "pex user %name of player% add worldedit.*"
								execute console command "pex user %name of player% add worldguard.*"
								execute player command "rg remove %name of player%"
								execute console command "pex user %name of player% remove worldedit.*"
								execute console command "pex user %name of player% remove worldguard.*"
								loop 100 times:
										send ""
								wait 1 second
								send "&7Usunales swoje miasto!"
								wait 2 second
								broadcast "&7Gracz o nicku&a %player%&7 usunal miasto o nazwie&a %argument-2%"
				if arg 1 is "sprzedaj":
						if arg 2 is not set:
								send "&7Wpisz nick gracza, ktoremu chcesz sprzedac miasto!"
						if arg 2 is set:
								if arg 2 is %offlineplayer%:
										send "&7Wyslales propozycje kupna miasta do gracza o nicku &a%argument-2%"
										send "&7Dostales propozycje kupna miasta od gracza o nicku &a%player%&7. Wpisz &a/kup&7, aby kupic, &a/ignoruj&7, aby ignorowac." to argument-offlineplayer
				if arg 1 is "dodaj":
						if arg 2 is not set:
								send "&7Wpisz nick gracza ktorego chcesz dodac."
						if arg 2 is set:
								if arg 2 is %offlineplayer%:
										send "&7Wyslales zaproszenie do gracza o nicku &a%argument-2%"
										send "&7Dostales zaproszenie do miasta od gracza o nicku &a%player%&7, aby dolaczyc wpisz &a/dolacz&7, aby odmowic wpisz &a/odmow" to argument-offlineplayer
				if arg 1 is "opusc":
						send "&7Trwa opuszczanie miasta."
						execute console command "pex user %name of player% add worldguard.*"
						execute player command "rg removemember %name of player% %loop-player%"
						execute console command "pex user %name of player% remove worldguard.*"
						loop 100 times:
								send ""
						wait 1 second 
						send "&7Opusciles miasto gracza o nicku&a %loop-player%"
						command /kup:
								trigger:
										execute console command "rg removeowner %loop-player% %loop-player%"
										execute console command "rg addowner %player% %loop-player%"
						command /ignoruj:
								trigger:
										send "&7Odmowiles graczowi o nicku&a %loop-player%"
										send "&7Gracz o nicku&a %player%&7 odmowil twojej propozycji!"
						command /dolacz:
								trigger:
										send "&7Dolaczyles do miasta gracza&a %loop-player%"
										send "&7Gracz o nicku&a %player%&7 dolaczyl do twojego miasta" to loop-player
										execute console command "rg addmember %player% %loop-player%"
						command /odmow:
								trigger:
										send "&7Odmowiles graczowi o nicku&a %loop-player%"
										send "&7Gracz o nicku&a %player%&7 odmowil na twoje zaproszenie."

Wykombinowałem cos takiego :D

Ale za bardzo nie wiem czy to dziala...

Prosze jak cos zle to popraw ;)

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

Ostatnio przeglądający 0

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

Konto

Nawigacja

Skonfiguruj powiadomienia push w przeglądarce

Chrome (Android)
  1. Stuknij ikonę kłódki obok paska adresu.
  2. Stuknij Uprawnienia → Powiadomienia.
  3. Dostosuj swoje ustawienie.
Chrome (Komputer)
  1. Kliknij ikonę kłódki na pasku adresu.
  2. Wybierz Ustawienia witryny.
  3. Znajdź Powiadomienia i dostosuj swoje ustawienie.