Skocz do zawartości
  • 0

Skrypty na msg


gnomq

Pytanie

Rekomendowane odpowiedzi

  • 0
Godzinę temu, gnomq2000 napisał:

Używanie prywatnych wiadomości co 5 sekund. Oczywiście ranga z uprawnieniem nie musi tego przestrzegać

Komenda '/mutemsg <gracz> <czas>' - blokuje graczowi pisanie prywatnych wiadomości na określony czas

 

Powinno zadziałać. Na samej górze skryptu ustawiasz sobie najpotrzebniejsze rzeczy, proszę.

options:
	msg-cooldown: 5 seconds
	msg-cooldown-message: &cMusisz odczekac jeszcze &6%{_c}% &csekund!
	msg-bypass: msg.bypass
	
function translateTimespan(t: timespan) :: text:
	replace all "seconds" with "sekund" in {_t}
	replace all "second" with "sekunde" in {_t}
	replace all "minutes" with "minut" in {_t}
	replace all "minute" with "minute" in {_t}
	replace all "hours" with "godzin" in {_t}
	replace all "hour" with "godzine" in {_t}
	replace all "months" with "miesiecy" in {_t}
	replace all "month" with "miesiac" in {_t}
	replace all "years" with "lat" in {_t}
	replace all "year" with "rok" in {_t}
	return "%{_t}%"

command /msg <player> <text>:
	trigger:
		if sender is not console:
			if {msg::mute::%player%::czas} and {msg::mute::%player%::timespan} are set:
				if difference between {msg::mute::%player%::czas} and now is greater than {msg::mute::%player%::timespan}:
					clear {msg::mute::%player%::*}
				else:
					send "&cJestes wyciszony! Nie mozesz pisac na msg!" to player
					stop
			if player doesn't have permission "msg.bypass":
				if {msg::cooldown::%player%} is not set:
					set {msg::cooldown::%player%} to now
					subtract {@msg-cooldown} from {msg::cooldown::%player%}
				if difference between {msg::cooldown::%player%} and now is less than {@msg-cooldown}:
					set {_c} to {msg::cooldown::%player%}
					add {@msg-cooldown} to {_c}
					set {_c} to difference between now and {_c}
					replace all "seconds" and "second" with "sekund" in {_c}
					send "{@msg-cooldown-message}" to player
					stop
				set {msg::cooldown::%player%} to now
		send "&7[&cTy &6-> &c%arg 1%&7] &b%arg 2%" to sender
		send "&7[&c%sender% &6-> &cTy&7] &b%arg 2%" to arg 1
		
command /mutemsg <offline player> <timespan>:
	trigger:
		if sender is not console:
			if player is not op:
				stop
		set {msg::mute::%arg 1%::czas} to now
		set {msg::mute::%arg 1%::timespan} to arg 2
		set {_m} to arg 2
		set {_m} to translateTimespan({_m})
		send "&cWyciszyles gracza &4%arg 1% &cna &6%{_m}%&c!" to sender

EDIT:

Tak, wiem, mogłem użyć m.in. 'cooldown' wbudowanego w komendę, lecz zdałem sobie z tego sprawę będąc już w połowie skryptu.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259934
Udostępnij na innych stronach

  • 0
31 minut temu, Kormic napisał:

Powinno zadziałać. Na samej górze skryptu ustawiasz sobie najpotrzebniejsze rzeczy, proszę.


options:
	msg-cooldown: 5 seconds
	msg-cooldown-message: &cMusisz odczekac jeszcze &6%{_c}% &csekund!
	msg-bypass: msg.bypass
	
function translateTimespan(t: timespan) :: text:
	replace all "seconds" with "sekund" in {_t}
	replace all "second" with "sekunde" in {_t}
	replace all "minutes" with "minut" in {_t}
	replace all "minute" with "minute" in {_t}
	replace all "hours" with "godzin" in {_t}
	replace all "hour" with "godzine" in {_t}
	replace all "months" with "miesiecy" in {_t}
	replace all "month" with "miesiac" in {_t}
	replace all "years" with "lat" in {_t}
	replace all "year" with "rok" in {_t}
	return "%{_t}%"

command /msg <player> <text>:
	trigger:
		if sender is not console:
			if {msg::mute::%player%::czas} and {msg::mute::%player%::timespan} are set:
				if difference between {msg::mute::%player%::czas} and now is greater than {msg::mute::%player%::timespan}:
					clear {msg::mute::%player%::*}
				else:
					send "&cJestes wyciszony! Nie mozesz pisac na msg!" to player
					stop
			if player doesn't have permission "msg.bypass":
				if {msg::cooldown::%player%} is not set:
					set {msg::cooldown::%player%} to now
					subtract {@msg-cooldown} from {msg::cooldown::%player%}
				if difference between {msg::cooldown::%player%} and now is less than {@msg-cooldown}:
					set {_c} to {msg::cooldown::%player%}
					add {@msg-cooldown} to {_c}
					set {_c} to difference between now and {_c}
					replace all "seconds" and "second" with "sekund" in {_c}
					send "{@msg-cooldown-message}" to player
					stop
				set {msg::cooldown::%player%} to now
		send "&7[&cTy &6-> &c%arg 1%&7] &b%arg 2%" to sender
		send "&7[&c%sender% &6-> &cTy&7] &b%arg 2%" to arg 1
		
command /mutemsg <offline player> <timespan>:
	trigger:
		if sender is not console:
			if player is not op:
				stop
		set {msg::mute::%arg 1%::czas} to now
		set {msg::mute::%arg 1%::timespan} to arg 2
		set {_m} to arg 2
		set {_m} to translateTimespan({_m})
		send "&cWyciszyles gracza &4%arg 1% &cna &6%{_m}%&c!" to sender

 

dzięki, a czy cooldown wiadomości na czacie z tego wyczarujesz?

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259955
Udostępnij na innych stronach

  • 0
Teraz, gnomq2000 napisał:

a czy zrobisz pisanie na czacie co 5 sekund (z odliczaniem)

 

1. 1 wątek = 1 zlecenie

2. Wyjaśnij w kolejnym wątku o co ci dokładnie chodzi z tym odliczaniem.

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259961
Udostępnij na innych stronach

  • 0
3 godziny temu, Kormic napisał:

Powinno zadziałać. Na samej górze skryptu ustawiasz sobie najpotrzebniejsze rzeczy, proszę.


options:
	msg-cooldown: 5 seconds
	msg-cooldown-message: &cMusisz odczekac jeszcze &6%{_c}% &csekund!
	msg-bypass: msg.bypass
	
function translateTimespan(t: timespan) :: text:
	replace all "seconds" with "sekund" in {_t}
	replace all "second" with "sekunde" in {_t}
	replace all "minutes" with "minut" in {_t}
	replace all "minute" with "minute" in {_t}
	replace all "hours" with "godzin" in {_t}
	replace all "hour" with "godzine" in {_t}
	replace all "months" with "miesiecy" in {_t}
	replace all "month" with "miesiac" in {_t}
	replace all "years" with "lat" in {_t}
	replace all "year" with "rok" in {_t}
	return "%{_t}%"

command /msg <player> <text>:
	trigger:
		if sender is not console:
			if {msg::mute::%player%::czas} and {msg::mute::%player%::timespan} are set:
				if difference between {msg::mute::%player%::czas} and now is greater than {msg::mute::%player%::timespan}:
					clear {msg::mute::%player%::*}
				else:
					send "&cJestes wyciszony! Nie mozesz pisac na msg!" to player
					stop
			if player doesn't have permission "msg.bypass":
				if {msg::cooldown::%player%} is not set:
					set {msg::cooldown::%player%} to now
					subtract {@msg-cooldown} from {msg::cooldown::%player%}
				if difference between {msg::cooldown::%player%} and now is less than {@msg-cooldown}:
					set {_c} to {msg::cooldown::%player%}
					add {@msg-cooldown} to {_c}
					set {_c} to difference between now and {_c}
					replace all "seconds" and "second" with "sekund" in {_c}
					send "{@msg-cooldown-message}" to player
					stop
				set {msg::cooldown::%player%} to now
		send "&7[&cTy &6-> &c%arg 1%&7] &b%arg 2%" to sender
		send "&7[&c%sender% &6-> &cTy&7] &b%arg 2%" to arg 1
		
command /mutemsg <offline player> <timespan>:
	trigger:
		if sender is not console:
			if player is not op:
				stop
		set {msg::mute::%arg 1%::czas} to now
		set {msg::mute::%arg 1%::timespan} to arg 2
		set {_m} to arg 2
		set {_m} to translateTimespan({_m})
		send "&cWyciszyles gracza &4%arg 1% &cna &6%{_m}%&c!" to sender

EDIT:

Tak, wiem, mogłem użyć m.in. 'cooldown' wbudowanego w komendę, lecz zdałem sobie z tego sprawę będąc już w połowie skryptu.

image.png.a3baa79cf371b3c5cc61ff96a6e0349e.png
to seconds mi nie pasuje

Edytowane przez gnomq2000
Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259995
Udostępnij na innych stronach

  • 0
1 minutę temu, gnomq2000 napisał:

image.png.a3baa79cf371b3c5cc61ff96a6e0349e.png
to seconds mi nie pasuje

Z wiadomości w options usuń "sekund" oraz użyj funkcji, którą załączyłem do skryptu w wątku z cooldownem na czat.

Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259996
Udostępnij na innych stronach

  • 0
5 minut temu, Kormic napisał:

Z wiadomości w options usuń "sekund" oraz użyj funkcji, którą załączyłem do skryptu w wątku z cooldownem na czat.

nie działa mi to, albo nie potrafię zrobić

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259998
Udostępnij na innych stronach

  • 0
10 minut temu, gnomq2000 napisał:

nie działa mi to, albo nie potrafię zrobić

options:
	msg-cooldown: 5 seconds
	msg-cooldown-message: &cMusisz odczekac jeszcze &6%{_c}%&c!
	msg-bypass: msg.bypass
	
function translateTimespan(t: timespan) :: text:
	set {_t} to "%{_t}%"
	replace all "seconds" with "sekund" in {_t}
	replace all "second" with "sekunde" in {_t}
	replace all "minutes" with "minut" in {_t}
	replace all "minute" with "minute" in {_t}
	replace all "hours" with "godzin" in {_t}
	replace all "hour" with "godzine" in {_t}
	replace all "months" with "miesiecy" in {_t}
	replace all "month" with "miesiac" in {_t}
	replace all "years" with "lat" in {_t}
	replace all "year" with "rok" in {_t}
	return "%{_t}%"

command /msg <player> <text>:
	trigger:
		if sender is not console:
			if {msg::mute::%player%::czas} and {msg::mute::%player%::timespan} are set:
				if difference between {msg::mute::%player%::czas} and now is greater than {msg::mute::%player%::timespan}:
					clear {msg::mute::%player%::*}
				else:
					send "&cJestes wyciszony! Nie mozesz pisac na msg!" to player
					stop
			if player doesn't have permission "msg.bypass":
				if {msg::cooldown::%player%} is not set:
					set {msg::cooldown::%player%} to now
					subtract {@msg-cooldown} from {msg::cooldown::%player%}
				if difference between {msg::cooldown::%player%} and now is less than {@msg-cooldown}:
					set {_c} to {msg::cooldown::%player%}
					add {@msg-cooldown} to {_c}
					set {_c} to difference between now and {_c}
					set {_c} to translateTimespan({_c})
					send "{@msg-cooldown-message}" to player
					stop
				set {msg::cooldown::%player%} to now
		send "&7[&cTy &6-> &c%arg 1%&7] &b%arg 2%" to sender
		send "&7[&c%sender% &6-> &cTy&7] &b%arg 2%" to arg 1
		
command /mutemsg <offline player> <timespan>:
	trigger:
		if sender is not console:
			if player is not op:
				stop
		set {msg::mute::%arg 1%::czas} to now
		set {msg::mute::%arg 1%::timespan} to arg 2
		set {_m} to arg 2
		set {_m} to translateTimespan({_m})
		send "&cWyciszyles gracza &4%arg 1% &cna &6%{_m}%&c!" to sender		
Edytowane przez Kormic
Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-259999
Udostępnij na innych stronach

  • 0
Teraz, Kormic napisał:

options:
	msg-cooldown: 5 seconds
	msg-cooldown-message: &cMusisz odczekac jeszcze &6%{_c}%&c!
	msg-bypass: msg.bypass
	
function translateTimespan(t: timespan) :: text:
	set {_t} to "%{_t}%"
	replace all "seconds" with "sekund" in {_t}
	replace all "second" with "sekunde" in {_t}
	replace all "minutes" with "minut" in {_t}
	replace all "minute" with "minute" in {_t}
	replace all "hours" with "godzin" in {_t}
	replace all "hour" with "godzine" in {_t}
	replace all "months" with "miesiecy" in {_t}
	replace all "month" with "miesiac" in {_t}
	replace all "years" with "lat" in {_t}
	replace all "year" with "rok" in {_t}
	return "%{_t}%"

command /msg <player> <text>:
	trigger:
		if sender is not console:
			if {msg::mute::%player%::czas} and {msg::mute::%player%::timespan} are set:
				if difference between {msg::mute::%player%::czas} and now is greater than {msg::mute::%player%::timespan}:
					clear {msg::mute::%player%::*}
				else:
					send "&cJestes wyciszony! Nie mozesz pisac na msg!" to player
					stop
			if player doesn't have permission "msg.bypass":
				if {msg::cooldown::%player%} is not set:
					set {msg::cooldown::%player%} to now
					subtract {@msg-cooldown} from {msg::cooldown::%player%}
				if difference between {msg::cooldown::%player%} and now is less than {@msg-cooldown}:
					set {_c} to {msg::cooldown::%player%}
					add {@msg-cooldown} to {_c}
					set {_c} to difference between now and {_c}
					replace all "seconds" and "second" with "sekund" in {_c}
					send "{@msg-cooldown-message}" to player
					stop
				set {msg::cooldown::%player%} to now
		send "&7[&cTy &6-> &c%arg 1%&7] &b%arg 2%" to sender
		send "&7[&c%sender% &6-> &cTy&7] &b%arg 2%" to arg 1
		
command /mutemsg <offline player> <timespan>:
	trigger:
		if sender is not console:
			if player is not op:
				stop
		set {msg::mute::%arg 1%::czas} to now
		set {msg::mute::%arg 1%::timespan} to arg 2
		set {_m} to arg 2
		set {_m} to translateTimespan({_m})
		send "&cWyciszyles gracza &4%arg 1% &cna &6%{_m}%&c!" to sender

image.png.5603c48d8786a137198035f5cb35272b.png

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-260000
Udostępnij na innych stronach

  • 0
Teraz, gnomq2000 napisał:

czy dałoby się zrobić aliases tego msg na np. /r, /m, /tell etc.?

Owszem, mógłbym, tylko jeśli ma być /reply, to będę musiał zdefiniować nową komendę, więc będziesz musiał poczekać chwilę.

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-260012
Udostępnij na innych stronach

  • 0
2 minuty temu, Kormic napisał:

Owszem, mógłbym, tylko jeśli ma być /reply, to będę musiał zdefiniować nową komendę, więc będziesz musiał poczekać chwilę.

okej, bo mi czyta /tell itp. z essentials, a tego nie chcę bo znów będą spamować :angrythonk:

Edytowane przez gnomq2000
Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-260015
Udostępnij na innych stronach

  • 0
7 minut temu, gnomq2000 napisał:

okej, bo mi czyta /tell itp. z essentials, a tego nie chcę bo znów będą spamować :angrythonk:

Dodałem aliasy oraz komendę /reply. Sprawdź czy wszystko poprawnie działa i w razie jakichś błędów napisz.

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-260016
Udostępnij na innych stronach

  • 0
4 minuty temu, Kormic napisał:

Zastąp linijki 69 i 70 tym, powinno zadziałać:


set {msg::last::%{msg::last::%player%}%} to player

 

działa :) a czy dodasz jakiś dźwięk, gdy dochodzi wiadomość do odbiorcy?

Odnośnik do komentarza
https://skript.pl/temat/41523-skrypty-na-msg/#findComment-260021
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ę...