Skocz do zawartości
  • 0

Nagrody za zaproszenie


Nieaktywny

Pytanie

Elo.

Proszę o napisanie skryptu na /ref i nick gracza, która jak np. zaprosi 5 osób na serwer oni wpiszą tą komendę to można odebrać jakąś nagrodę. /nagrodyzrefa i tam nagrody co 5,10,15,20,25 i tak do 50 osób, jakieś ciekawe nagrody. Osoby które zaprosił mogą wpisać komendę tylko raz, i nagrodę odebrać również tylko raz.

Edytowane przez Nieaktywny
Odnośnik do komentarza
https://skript.pl/temat/20817-nagrody-za-zaproszenie/
Udostępnij na innych stronach

2 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
command /ref <player>:
	trigger:
		if {Ref.%player%} is true:
			if arg 1 is set:
				set {Ref.%player%} to false			
				add 1 to {Invite.%player-arg%}
				send "Zostales zaproszony przez %player-arg%"
variables:
	{Invite.%player%} = 0
	{Ref.%player%} = true
	{N1.%player%} = true
command /nagrodyzrefa:
	trigger:
		if {Invite.%player%} is 5:
			if {N1.%player%} is true:
				give 1 diamond to player
				set {N2.%player%} to true
				set {N1.%player%} to false
		if {Invite.%player%} is 10:
			if {N2.%player%} is true:
				give 1 diamond to player
				set {N3.%player%} to true
				set {N2.%player%} to false
		if {Invite.%player%} is 15:
			if {N3.%player%} is true:
				give 1 diamond to player
				set {N4.%player%} to true
				set {N3.%player%} to false
		if {Invite.%player%} is 20:
			if {N4.%player%} is true:
				give 1 diamond to player
				set {N5.%player%} to true
				set {N4.%player%} to false
		if {Invite.%player%} is 25:
			if {N5.%player%} is true:
				give 1 diamond to player
				set {N6.%player%} to true
				set {N5.%player%} to false
		if {Invite.%player%} is 30:
			if {N6.%player%} is true:
				give 1 diamond to player
				set {N7.%player%} to true
				set {N6.%player%} to false
		if {Invite.%player%} is 35:
			if {N7.%player%} is true:
				give 1 diamond to player
				set {N8.%player%} to true
				set {N7.%player%} to false
		if {Invite.%player%} is 40:
			if {N8.%player%} is true:
				give 1 diamond to player
				set {N9.%player%} to true
				set {N8.%player%} to false
		if {Invite.%player%} is 45:
			if {N9.%player%} is true:
				give 1 diamond to player
				set {N10.%player%} to true
				set {N9.%player%} to false
		if {Invite.%player%} is 50:
			if {N10.%player%} is true:
				give 1 diamond to player
				set {N10.%player%} to false

takie coś?

Edytowane przez SupcioXD
Zrobione ze nie mozna brac caly czas
Odnośnik do komentarza
https://skript.pl/temat/20817-nagrody-za-zaproszenie/#findComment-141410
Udostępnij na innych stronach

  • 0
options:

	# ustawienia
			loop {@setting1} times:
				number of {affiliates::invite::playerlist::%player%} >= {@ilosc_zaproszen.%loop-number%}:
					{affiliates::nagrody::ostatniaodebrana::%player%} < {@ostatnia_odebrana.%loop-number%}:
						set {affiliates::nagrody::ostatniaodebrana::%player%} to {@odebrana_teraz.%loop-number%}
	setting1: 50 # Ogolna ilosc nagrod

	ilosc_zaproszen.1: 5 # Ile zaproszen na pierwsza nagrode
	ostatnia_odebrana.1: 0
	odebrana_teraz: 5

	ilosc_zaproszen.2: 10
	ostatnia_odebrana.2: 5
	odebrana_teraz: 10

	ilosc_zaproszen.3: 15
	ostatnia_odebrana.3: 10
	odebrana_teraz: 15
	
	# i tak dalej...
variables:
	{affiliates::nagrody::ostatniaodebrana::%player%} = 0
command /affiliates [<player>]:
	description: Affiliates code.
	trigger:
		if {affiliates::invite::%player%} isn't set:
			add player to {affiliates::invite::playerlist::%player-argument%}
			set {affiliates::invite::%player%} to player-argument
		else:
			send "&8» &cZostales juz zaproszony" to the player
command /nagrody:
	description: Nagrody za zapraszanie.
	trigger:
		if {affiliates::invite::playerlist::%player%} is set:
			loop {@setting1} times:
				number of {affiliates::invite::playerlist::%player%} >= {@ilosc_zaproszen.%loop-number%}:
					{affiliates::nagrody::ostatniaodebrana::%player%} < {@ostatnia_odebrana.%loop-number%}:
						set {affiliates::nagrody::ostatniaodebrana::%player%} to {@odebrana_teraz.%loop-number%}
						# tu sobie mozesz dodac nagrode lecz ona musi byc zautomatyzowana ponizej w kodzie masz przyklad.
						send "&8» &6Wydano nagrode za %loop-number% graczy" to the player
					else:
						send "&8» &cNiestety, ale odbierales juz wieksza nagrode i nie mozesz mniejszych :C" to the player
				else:
					send "&8» &cZa malo zaprosiles graczy" to the player
		else:
			send "&8» &cNawet nikogo jeszcze nie zaprosiles, a juz lecisz do nagrody!" to the player

				
Jak zautomatyzowac dawanie nagrody?

w przypadku przedmiotu

mozna to zrobic poprzez 'give' lub 'add' wiec

give {@ilosc_przedmiotu.%loop-number%} {@przedmiot.%loop-number%} to player (ew.)
add {@ilosc_przedmiotu.%loop-number%} {@przedmiot.%loop-number%} to player

W options dopisujemy 
  > ilosc_przedmiotu.1: 5
  > przedmiot.1: diamond named "&3Diament zaglady"

W przypadku komendy;

	console command "{@komenda.%loop-number%}"
	(ew.) player command...

W options dopisujemy
  > komenda.1: ban %player% 

Jeśli potrzebujesz czegoś innego napisz do mnie! :D

//edit: @SupcioXD mówiłem już Tobie coś... wykorzystaj czasem pętle i skrypt od razu ma lepszą wydajność.

Edytowane przez esej
Odnośnik do komentarza
https://skript.pl/temat/20817-nagrody-za-zaproszenie/#findComment-141412
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ę...