Skocz do zawartości
  • 0

Osobny chat w każdym regionie


Gość Usunięty#5009

Pytanie

Gość Usunięty#5009

Hej,

Napisze mi ktoś skrypt aby w każdym regionie z world guard był osobny chat. Czyli jak jestem w regionie 1 to widzę tylko to co piszą osoby z regionu 1 a osoby z regionu 2 nie widzą tego. Chce także aby jeśli gracz nie jest w żadnym regionie z world guard aby wiadomość widzieli wszyscy. Chce też aby przed nickiem gracza wyświetlane było w jakim jest regionie czyli np. jak jest w regionie "lobby" aby przed nickiem wyświetlało [Lobby] Z góry wielkie dzięki za pomoc :)

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/
Udostępnij na innych stronach

Rekomendowane odpowiedzi

  • 0
Gość Usunięty#5009
7 godzin temu, xMarcinos napisał:

 on region enter:
    wait 1 tick
    set {region.%player%} to "%region%"

on region leave:
    clear {region.%player%}

on chat:
    cancel event
    if {region.%sender%} is not set:
        broadcast "&3[Global] &7%player's displayname%&7> &f%message%"
    else:
        loop all players:
            if {region.%loop-player%} is {region.%sender%}:
            	set {_wyrazy::*} to {region.%sender%} split by " "
                loop {_wyrazy::*}:
                    set {_duzaLitera} to first 1 character of loop-value
                    set {_duzaL2} to convert string {_duzaLitera} to uppercase
                    set {_reszta} to subtext of loop-value from characters 2 to (length of loop-value)
                    add "%{_duzaL2}%%{_reszta}%" to {_wyrazy2::*}
                set {_pelnanazwa} to join {_wyrazy2::*} with " "
                set {_nazwagracza} to player's displayname
                replace all "[%world of player%]" in {_nazwagracza} with ""
                send "&3[%{_pelnanazwa}%] &7%{_nazwagracza}%&7> &f%message%" to loop-player 

Takie coś powinno wyświetlać wszystkie wyrazy z wielką literą na początku. Nie testowałem, więc nie wiem czy działa, ale powinno. Napisałem także, aby w wyświetlanej nazwie gracza w wiadomości "[world]" było zastępowane "" (niczym, usuwane), więc teraz chyba wszystko powinno działać tak jak chciałeś.

Niestety ale tyle błędów że się nie mieszczą na jednym screenshoocie xD

 

q7XqGRT.png

OZszlAe.png

Edytowane przez Cubixor
Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114117
Udostępnij na innych stronach

  • 0

Proszę:

Spoiler

on chat:
	set {_x} to "%regions at player%"
	loop length of {_x} times:
		if "%subtext of {_x} from index loop-number and loop-number%" is " ":
			set {_i} to loop-number - 1
			exit loop
	set {_region} to  "%1 first characters of {_x}%"
	replace all "a" with "A" in {_region}
	replace all "b" with "B" in {_region}
	replace all "c" with "C" in {_region}
	replace all "d" with "D" in {_region}
	replace all "e" with "E" in {_region}
	replace all "f" with "F" in {_region}
	replace all "g" with "G" in {_region}
	replace all "h" with "H" in {_region}
	replace all "i" with "I" in {_region}
	replace all "j" with "J" in {_region}
	replace all "k" with "K" in {_region}
	replace all "l" with "L" in {_region}
	replace all "m" with "M" in {_region}
	replace all "n" with "N" in {_region}
	replace all "o" with "O" in {_region}
	replace all "p" with "P" in {_region}
	replace all "r" with "R" in {_region}
	replace all "s" with "S" in {_region}
	replace all "t" with "T" in {_region}
	replace all "u" with "U" in {_region}
	replace all "v" with "V" in {_region}
	replace all "w" with "W" in {_region}
	replace all "x" with "X" in {_region}
	replace all "y" with "Y" in {_region}
	replace all "z" with "Z" in {_region}
	set {_reg} to "%{_region}%%subtext of {_x} from index 2 and {_i}%"
	if "%regions at player%" is "<none>":
		stop
	cancel event
	loop all players:
		if "%regions at loop-player%" contains "%regions at player%":
			send "[%{_reg}%]%display name of player% >> %message%" to loop-player
			

 

 

Edytowane przez knugi
Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114160
Udostępnij na innych stronach

  • 0
Gość Usunięty#5009
5 godzin temu, xMarcinos napisał:

@Cubixor te błędy głównie wynikają z tego że w jednym miejscu przed tekstem jest "<tab>", a w drugim spacje.

A mógłbyś je poprawić tak aby skrypt działał? Byłbym bardzo wdzięczny.

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114428
Udostępnij na innych stronach

  • 0

@Cubixor podałem ci przecież bez błędów kod xD

 

Dnia 26.02.2017 o 18:00, knugi napisał:

Proszę:

  Pokaż ukrytą zawartość


on chat:
	set {_x} to "%regions at player%"
	loop length of {_x} times:
		if "%subtext of {_x} from index loop-number and loop-number%" is " ":
			set {_i} to loop-number - 1
			exit loop
	set {_region} to  "%1 first characters of {_x}%"
	replace all "a" with "A" in {_region}
	replace all "b" with "B" in {_region}
	replace all "c" with "C" in {_region}
	replace all "d" with "D" in {_region}
	replace all "e" with "E" in {_region}
	replace all "f" with "F" in {_region}
	replace all "g" with "G" in {_region}
	replace all "h" with "H" in {_region}
	replace all "i" with "I" in {_region}
	replace all "j" with "J" in {_region}
	replace all "k" with "K" in {_region}
	replace all "l" with "L" in {_region}
	replace all "m" with "M" in {_region}
	replace all "n" with "N" in {_region}
	replace all "o" with "O" in {_region}
	replace all "p" with "P" in {_region}
	replace all "r" with "R" in {_region}
	replace all "s" with "S" in {_region}
	replace all "t" with "T" in {_region}
	replace all "u" with "U" in {_region}
	replace all "v" with "V" in {_region}
	replace all "w" with "W" in {_region}
	replace all "x" with "X" in {_region}
	replace all "y" with "Y" in {_region}
	replace all "z" with "Z" in {_region}
	set {_reg} to "%{_region}%%subtext of {_x} from index 2 and {_i}%"
	if "%regions at player%" is "<none>":
		stop
	cancel event
	loop all players:
		if "%regions at loop-player%" contains "%regions at player%":
			send "[%{_reg}%]%display name of player% >> %message%" to loop-player
			

 

 

 

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114732
Udostępnij na innych stronach

  • 0

Proszę poprawione, bo wcześniej nie doczytałem:

 

Spoiler

on chat:
	set {_x} to "%regions at player%"
	set {_x} to first index of " in" in {_x} - 1 characters of {_x}
	set {_wyrazy::*} to {_x} split at "_" 
	set {_reg} to ""
	loop {_wyrazy::*}:
		set {_region} to  "%1 first characters of loop-value%"
		replace all "a" with "A" in {_region}
		replace all "b" with "B" in {_region}
		replace all "c" with "C" in {_region}
		replace all "d" with "D" in {_region}
		replace all "e" with "E" in {_region}
		replace all "f" with "F" in {_region}
		replace all "g" with "G" in {_region}
		replace all "h" with "H" in {_region}
		replace all "i" with "I" in {_region}
		replace all "j" with "J" in {_region}
		replace all "k" with "K" in {_region}
		replace all "l" with "L" in {_region}
		replace all "m" with "M" in {_region}
		replace all "n" with "N" in {_region}
		replace all "o" with "O" in {_region}
		replace all "p" with "P" in {_region}
		replace all "r" with "R" in {_region}
		replace all "s" with "S" in {_region}
		replace all "t" with "T" in {_region}
		replace all "u" with "U" in {_region}
		replace all "v" with "V" in {_region}
		replace all "w" with "W" in {_region}
		replace all "x" with "X" in {_region}
		replace all "y" with "Y" in {_region}
		replace all "z" with "Z" in {_region}
		set {_wyrazy::%loop-index%} to "%{_region}%%subtext of loop-value from index 2 and length of loop-value%"
		set {_reg} to "%{_reg}% %{_wyrazy::%loop-index%}%"
	set {_reg} to last length of {_reg} - 1 characters of {_reg}
	if "%regions at player%" is "<none>":
		stop
	cancel event
	loop all players:
		if "%regions at loop-player%" contains "%regions at player%":
			send "[%{_reg}%]%display name of player% >> %message%" to loop-player

 

 

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114736
Udostępnij na innych stronach

  • 0
Gość Usunięty#5009
28 minut temu, knugi napisał:

Proszę poprawione, bo wcześniej nie doczytałem:

 

  Ukryj zawartość


on chat:
	set {_x} to "%regions at player%"
	set {_x} to first index of " in" in {_x} - 1 characters of {_x}
	set {_wyrazy::*} to {_x} split at "_" 
	set {_reg} to ""
	loop {_wyrazy::*}:
		set {_region} to  "%1 first characters of loop-value%"
		replace all "a" with "A" in {_region}
		replace all "b" with "B" in {_region}
		replace all "c" with "C" in {_region}
		replace all "d" with "D" in {_region}
		replace all "e" with "E" in {_region}
		replace all "f" with "F" in {_region}
		replace all "g" with "G" in {_region}
		replace all "h" with "H" in {_region}
		replace all "i" with "I" in {_region}
		replace all "j" with "J" in {_region}
		replace all "k" with "K" in {_region}
		replace all "l" with "L" in {_region}
		replace all "m" with "M" in {_region}
		replace all "n" with "N" in {_region}
		replace all "o" with "O" in {_region}
		replace all "p" with "P" in {_region}
		replace all "r" with "R" in {_region}
		replace all "s" with "S" in {_region}
		replace all "t" with "T" in {_region}
		replace all "u" with "U" in {_region}
		replace all "v" with "V" in {_region}
		replace all "w" with "W" in {_region}
		replace all "x" with "X" in {_region}
		replace all "y" with "Y" in {_region}
		replace all "z" with "Z" in {_region}
		set {_wyrazy::%loop-index%} to "%{_region}%%subtext of loop-value from index 2 and length of loop-value%"
		set {_reg} to "%{_reg}% %{_wyrazy::%loop-index%}%"
	set {_reg} to last length of {_reg} - 1 characters of {_reg}
	if "%regions at player%" is "<none>":
		stop
	cancel event
	loop all players:
		if "%regions at loop-player%" contains "%regions at player%":
			send "[%{_reg}%]%display name of player% >> %message%" to loop-player

 

 

No dobra wszystko działa ale czy dało się by zrobić aby jeszcze nazwa tego regionu była np koloru indygo?

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114750
Udostępnij na innych stronach

  • 0

Czemu nie, po prostu w 

send "[%{_reg}%]%display name of player% >> %message%" to loop-player

po [ a przed % wpisujesz kolor jaki chcesz :)

np <yellow> lub &6 to zależy od Ciebie, nie do końca wiem jaki numerek ma indygo więc sobie wstaw jaki chcesz :)

 

//Indygo to bodajże &d albo &5

Edytowane przez knugi
Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114752
Udostępnij na innych stronach

  • 0
Gość Usunięty#5009
12 minut temu, knugi napisał:

Czemu nie, po prostu w 


send "[%{_reg}%]%display name of player% >> %message%" to loop-player

po [ a przed % wpisujesz kolor jaki chcesz :)

np <yellow> lub &6 to zależy od Ciebie, nie do końca wiem jaki numerek ma indygo więc sobie wstaw jaki chcesz :)

 

//Indygo to bodajże &d albo &5

Niestety gdy wpisuję &9 lub nazwę koloru w <> nie działa.

Odnośnik do komentarza
https://skript.pl/temat/16437-osobny-chat-w-ka%C5%BCdym-regionie/#findComment-114756
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ę...