Skocz do zawartości
  • 0

Skrypt na Historie Przelewów


Pytanie

Siemka,
Mam gotowy skrypt na Bank i przelewy (Przelewy, wpłaty i wypłaty z banku) Pytanie czy da się zrobić historie przelewów do Gui, które juz mam zrobione?
Kod:
 

command /konto:
	trigger:
		set {_menuMoney} to a new chest inventory with 1 row with name "{@tag} &6Konto"
		set slot (integers between 0 and 2) and 4 and (integers between 6 and 9) of {_menuMoney} to green stained glass pane named "&7" with lore ""
		set slot 3 of {_menuMoney} to player head named "&2Konto &6Osobiste" with lore "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Osobiste" and "&2-------------" and "&6» &2$%{playerAccountMoney.%player%}%" and "&6-------------" and "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Firmowe(Miasto)" and "&2-------------" and "&6» &2$%{playerCityMoney.%player%}%"
		set slot 5 of {_menuMoney} to paper named "&2Historia &6Przelewów" with lore "&6&l| &2Ostatnie Przelewy:" and ""
		open {_menuMoney} to player


------------------------
command /przelej [<number>] [<offlineplayer>]:
    trigger:
        if arg 1 is not set:
            send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
            stop
        if arg 2 is not set:
            send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
            stop
        if arg 1 is set:
            if arg 2 is not set:
                send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
                stop
            if arg 2 is set:
                if {_gracz} is not player:
                    set {_gracz} to arg 2 
                    set {_kasa} to arg 1 
                    if {_gracz} is set:
                        if {_kasa} is set:
                            if {_kasa} is less than {playerAccountMoney.%player%}:
                                send "{@tag} &7Nie masz środków na koncie!" to player
                                stop
                            if {playerAccountMoney.%player%} is more or equal to {_kasa}:
                                send "{@tag} &7Przelano &2%{_kasa}% &7do &6%{_gracz}%"
                                send "{@tag} &7Otrzymałeś/aś &2%{_kasa}% od &6%{_gracz}%" to {_gracz}
                                remove {_kasa} from {playerAccountMoney.%player%}
                                add {_kasa} to {playerAccountMoney.%{_gracz}%}
                            else:
                                send "{@tag} &7Brak środków na koncie!" to player
                                stop
                else:
                    send "{@tag} &7Nie możesz wysłać pieniędzy do samego siebie!" to player
            else:
                send "{@tag} &7Podaj gracza!" to player
        else:
            send "{@tag} &7Podaj kwote do przelewu!" to player

command /bank [<text>] [<number>]:
    trigger:
        if arg 1 is not set:
            send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
        if arg 1 is set:
            if arg 2 is not set:
                send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
            if arg 1 is "wplac":
                set {_accountMoney} to arg 2
                if {_accountMoney} is set:
                    if {_accountMoney} is less than player's balance:
                        send "{@tag} &7Brak środków przy sobie!"
                        stop
                    if player's balance is more or equal to {_accountMoney}:
                        add {_accountMoney} to {playerAccountMoney.%player%}
                        remove {_accountMoney} from player's balance
                        send "{@tag} &7Wpłaciłes/aś &6%{_accountMoney}% &7do &2Banku!" to player
                    else:
                        send "{@tag} &7Nie masz tyle przy sobie!" to player
            if arg 1 is "wyplac":
                set {_bankMoney} to arg 2
                if {_bankMoney} is set:
                    if {_bankMoney} is less than {playerAccountMoney.%player%}:
                        send "{@tag} &7Brak środków na koncie!"
                        stop
                    if {playerAccountMoney.%player%} is more or equal to {_bankMoney}:
                        add {_bankMoney} to player's balance
                        remove {_bankMoney} from {playerAccountMoney.%player%}
                        send "{@tag} &7Wypłaciłeś/aś &6%{_bankMoney}% &7z &2Banku!" to player
                    else:
                        send "{@tag} &7Nie masz tyle w &2Banku!" to player

 

Edytowane przez TheFightaz
Odnośnik do komentarza
https://skript.pl/temat/51227-skrypt-na-historie-przelew%C3%B3w/
Udostępnij na innych stronach

3 odpowiedzi na to pytanie

Rekomendowane odpowiedzi

  • 0
Spoiler
options:
	tag: &8Cos
	sizeOfHistory: 3 #Ile ostatnich wynikow ma pokazywac historia.

on join:
	if {playerAccountMoney.%player%} is not set:
		set {playerAccountMoney.%player%} to 0
		set {playerCityMoney.%player%} to 0
command /konto:
	trigger:
		set {_menuMoney} to a new chest inventory with 1 row with name "{@tag} &6Konto"
		set slot (integers between 0 and 2) and 4 and (integers between 6 and 9) of {_menuMoney} to green stained glass pane named "&7" with lore ""
		set slot 3 of {_menuMoney} to player head named "&2Konto &6Osobiste" with lore "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Osobiste" and "&2-------------" and "&6» &2$%{playerAccountMoney.%player%}%" and "&6-------------" and "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Firmowe(Miasto)" and "&2-------------" and "&6» &2$%{playerCityMoney.%player%}%"
		set slot 5 of {_menuMoney} to paper named "&2Historia &6Przelewów" with lore "&6&l| &2Ostatnie Przelewy:" and {playerAccountMoney.%player%::*}
		open {_menuMoney} to player


#------------------------
command /przelej [<number>] [<offlineplayer>]:
	trigger:
		if arg 1 is not set:
			send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
			stop
		if arg 2 is not set:
			send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
			stop
		if arg 1 is set:
			if arg 2 is not set:
				send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
				stop
			if arg 2 is set:
				if {_gracz} is not player:
					set {_gracz} to arg 2 
					set {_kasa} to arg 1 
					if {_gracz} is set:
						if {_kasa} is set:
							if {_kasa} is larger than {playerAccountMoney.%player%}:
								send "{@tag} &7Nie masz środków na koncie!" to player
								stop
							if {playerAccountMoney.%player%} is more or equal to {_kasa}:
								send "{@tag} &7Przelano &2%{_kasa}% &7do &6%{_gracz}%"
								send "{@tag} &7Otrzymałeś/aś &2%{_kasa}% od &6%{_gracz}%" to {_gracz}
								remove {_kasa} from {playerAccountMoney.%player%}
								add {_kasa} to {playerAccountMoney.%{_gracz}%}
								if size of {playerAccountMoney.%player%::*} is larger than or equal to {@sizeOfHistory}:
									clear {playerAccountMoney.%player%::1}
									set {playerAccountMoney.%player%::*} to {playerAccountMoney.%player%::*}
								if size of {playerAccountMoney.%{_gracz}%::*} is larger than or equal to {@sizeOfHistory}:
									clear {playerAccountMoney.%{_gracz}%::1}
									set {playerAccountMoney.%{_gracz}%::*} to {playerAccountMoney.%{_gracz}%::*}
								add "&8[&7%now%&8] &6%player% &7-> &6%{_gracz}% &2$%{_kasa}%" to {playerAccountMoney.%player%::*}
								add "&8[&7%now%&8] &6%{_gracz}% &7<- &6%player% &2$%{_kasa}%" to {playerAccountMoney.%{_gracz}%::*}
							else:
								send "{@tag} &7Brak środków na koncie!" to player
								stop
				else:
					send "{@tag} &7Nie możesz wysłać pieniędzy do samego siebie!" to player
			else:
				send "{@tag} &7Podaj gracza!" to player
		else:
			send "{@tag} &7Podaj kwote do przelewu!" to player

command /bank [<text>] [<number>]:
	trigger:
		if arg 1 is not set:
			send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
		if arg 1 is set:
			if arg 2 is not set:
				send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
			if arg 1 is "wplac":
				set {_accountMoney} to arg 2
				if {_accountMoney} is set:
					if {_accountMoney} is larger than player's balance:
						send "{@tag} &7Brak środków przy sobie!"
						stop
					if player's balance is more or equal to {_accountMoney}:
						add {_accountMoney} to {playerAccountMoney.%player%}
						remove {_accountMoney} from player's balance
						send "{@tag} &7Wpłaciłes/aś &6%{_accountMoney}% &7do &2Banku!" to player
					else:
						send "{@tag} &7Nie masz tyle przy sobie!" to player
			if arg 1 is "wyplac":
				set {_bankMoney} to arg 2
				if {_bankMoney} is set:
					if {_bankMoney} is less than {playerAccountMoney.%player%}:
						send "{@tag} &7Brak środków na koncie!"
						stop
					if {playerAccountMoney.%player%} is more or equal to {_bankMoney}:
						add {_bankMoney} to player's balance
						remove {_bankMoney} from {playerAccountMoney.%player%}
						send "{@tag} &7Wypłaciłeś/aś &6%{_bankMoney}% &7z &2Banku!" to player
					else:
						send "{@tag} &7Nie masz tyle w &2Banku!" to player
	

 

Proszę bardzo. Od razu poprawiłem trochę Ci tamten kod, bo gdy miałem 100$ a chciałem przelać tylko 5 to nie mogłem, bo pisało że nie mam tyle przy sobie :P 

Jedynie można wysłać całość pieniędzy.

Odnośnik do komentarza
https://skript.pl/temat/51227-skrypt-na-historie-przelew%C3%B3w/#findComment-315636
Udostępnij na innych stronach

  • 0
Godzinę temu, knugi napisał:
  Ukryj zawartość
options:
	tag: &8Cos
	sizeOfHistory: 3 #Ile ostatnich wynikow ma pokazywac historia.

on join:
	if {playerAccountMoney.%player%} is not set:
		set {playerAccountMoney.%player%} to 0
		set {playerCityMoney.%player%} to 0
command /konto:
	trigger:
		set {_menuMoney} to a new chest inventory with 1 row with name "{@tag} &6Konto"
		set slot (integers between 0 and 2) and 4 and (integers between 6 and 9) of {_menuMoney} to green stained glass pane named "&7" with lore ""
		set slot 3 of {_menuMoney} to player head named "&2Konto &6Osobiste" with lore "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Osobiste" and "&2-------------" and "&6» &2$%{playerAccountMoney.%player%}%" and "&6-------------" and "&6&l| &2Stan Konta" and "&6&l| &2Typ &b: &2Firmowe(Miasto)" and "&2-------------" and "&6» &2$%{playerCityMoney.%player%}%"
		set slot 5 of {_menuMoney} to paper named "&2Historia &6Przelewów" with lore "&6&l| &2Ostatnie Przelewy:" and {playerAccountMoney.%player%::*}
		open {_menuMoney} to player


#------------------------
command /przelej [<number>] [<offlineplayer>]:
	trigger:
		if arg 1 is not set:
			send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
			stop
		if arg 2 is not set:
			send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
			stop
		if arg 1 is set:
			if arg 2 is not set:
				send "{@tag} &7Poprawne uzycie &2/przelej &6<ilość> <nick>" to player
				stop
			if arg 2 is set:
				if {_gracz} is not player:
					set {_gracz} to arg 2 
					set {_kasa} to arg 1 
					if {_gracz} is set:
						if {_kasa} is set:
							if {_kasa} is larger than {playerAccountMoney.%player%}:
								send "{@tag} &7Nie masz środków na koncie!" to player
								stop
							if {playerAccountMoney.%player%} is more or equal to {_kasa}:
								send "{@tag} &7Przelano &2%{_kasa}% &7do &6%{_gracz}%"
								send "{@tag} &7Otrzymałeś/aś &2%{_kasa}% od &6%{_gracz}%" to {_gracz}
								remove {_kasa} from {playerAccountMoney.%player%}
								add {_kasa} to {playerAccountMoney.%{_gracz}%}
								if size of {playerAccountMoney.%player%::*} is larger than or equal to {@sizeOfHistory}:
									clear {playerAccountMoney.%player%::1}
									set {playerAccountMoney.%player%::*} to {playerAccountMoney.%player%::*}
								if size of {playerAccountMoney.%{_gracz}%::*} is larger than or equal to {@sizeOfHistory}:
									clear {playerAccountMoney.%{_gracz}%::1}
									set {playerAccountMoney.%{_gracz}%::*} to {playerAccountMoney.%{_gracz}%::*}
								add "&8[&7%now%&8] &6%player% &7-> &6%{_gracz}% &2$%{_kasa}%" to {playerAccountMoney.%player%::*}
								add "&8[&7%now%&8] &6%{_gracz}% &7<- &6%player% &2$%{_kasa}%" to {playerAccountMoney.%{_gracz}%::*}
							else:
								send "{@tag} &7Brak środków na koncie!" to player
								stop
				else:
					send "{@tag} &7Nie możesz wysłać pieniędzy do samego siebie!" to player
			else:
				send "{@tag} &7Podaj gracza!" to player
		else:
			send "{@tag} &7Podaj kwote do przelewu!" to player

command /bank [<text>] [<number>]:
	trigger:
		if arg 1 is not set:
			send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
		if arg 1 is set:
			if arg 2 is not set:
				send "{@tag} &7Poprawne uzycie komendy &2/bank &6<wplac&7/&6wyplac> <ilosc>" to player
			if arg 1 is "wplac":
				set {_accountMoney} to arg 2
				if {_accountMoney} is set:
					if {_accountMoney} is larger than player's balance:
						send "{@tag} &7Brak środków przy sobie!"
						stop
					if player's balance is more or equal to {_accountMoney}:
						add {_accountMoney} to {playerAccountMoney.%player%}
						remove {_accountMoney} from player's balance
						send "{@tag} &7Wpłaciłes/aś &6%{_accountMoney}% &7do &2Banku!" to player
					else:
						send "{@tag} &7Nie masz tyle przy sobie!" to player
			if arg 1 is "wyplac":
				set {_bankMoney} to arg 2
				if {_bankMoney} is set:
					if {_bankMoney} is less than {playerAccountMoney.%player%}:
						send "{@tag} &7Brak środków na koncie!"
						stop
					if {playerAccountMoney.%player%} is more or equal to {_bankMoney}:
						add {_bankMoney} to player's balance
						remove {_bankMoney} from {playerAccountMoney.%player%}
						send "{@tag} &7Wypłaciłeś/aś &6%{_bankMoney}% &7z &2Banku!" to player
					else:
						send "{@tag} &7Nie masz tyle w &2Banku!" to player
	

 

Proszę bardzo. Od razu poprawiłem trochę Ci tamten kod, bo gdy miałem 100$ a chciałem przelać tylko 5 to nie mogłem, bo pisało że nie mam tyle przy sobie :P 

Jedynie można wysłać całość pieniędzy.

Działa, Dzięki wielkie! O to mi chodziło. Wielki + dla ciebie!


Edit:
Jeszcze pytanie, bo tam na dole jest linijka dotycząca komendy /bank i problem w tym, ze moge wpłacać kase na -
Edit2:
Juz ogarnałem. Mozna zamykac!

Edytowane przez TheFightaz
Odnośnik do komentarza
https://skript.pl/temat/51227-skrypt-na-historie-przelew%C3%B3w/#findComment-315639
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ę...