Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- on load:
- # @! Auctions+
- # @! skrypt umozliwiajacy tworzenie
- # @! aukcji na twoim serwerze.
- # @!
- # @! Wymagania:
- # @!
- # @! - Skript
- # @! - iConomy lub Essentials (do ekonomii)
- # @!
- # @! Uprawnienia:
- # @!
- # @! (podstawowe)
- # @!
- # @! - auctions.default
- # @!
- # @! (ponadpodstawowe)
- # @!
- # @! - auctions.admin
- # @!
- # @! Komendy:
- # @!
- # @! - /aukcja pomoc (glowna komenda Auc+)
- # @!
- # @! Autor: krzysek
- # @! Wersja: 0.3
- # @!
- # @! Ustawienia:
- # @!
- #
- # @! true = tak, false = nie
- #
- # @! Czas trwania pojedynczej aukcji
- # @! Najlepiej ustawiac po wielokrotnosci 30
- # @! w przeciwnym wypadku skrypt nie bedzie dzialac
- # @! 30s = odswiezanie czasu aukcji.
- set {auc.settings::time} to 120
- # @! Koncowa wiadomosc zakonczenia aukcji
- # @! Zmienne:
- # @! {OWNER} = nazwa wlasciciela aukcji
- # @! {WINNER} = nazwa osoby wygrywajacej aukcje (nie dot. end-fail)
- # @! {PRICE} = koncowa kwota aukcji
- set {auc.settings::end-success} to "&a&lAukcja uzytkownika &8&l{OWNER} &a&lzostala zakonczona &c&l! &a&lAukcje wygral &8&l{WINNER}&a&l, zaplacil &8&l{PRICE} $."
- set {auc.settings::end-fail} to "&a&lAukcja uzytkownika &8&l{OWNER} &a&lzostala zakonczona &c&l! &8&lBrak ofert kupna."
- # @! Czy wyglad wiadomosci wyswietlanej
- # @! przez komende /money ma byc
- # @! podmieniana na wiadomosc skryptu
- set {auc.settings::change-command} to true
- # @! Jesli true (tak), to na jaka
- # @! Zmienne:
- # @! {MONEY} = pieniadze uzytkownika
- # @! {PLAYER} = nazwa uzytkownika
- set {auc.settings::change-command-format} to "&a&lTwoj stan konta, {PLAYER} &a&lwynosi: &8&l{MONEY}"
- # @! Co jaka sume pieniedzy ma sie
- # @! podbijac stawka aukcji po
- # @! wpisaniu /aukcja podbij
- set {auc.settings::raise} to 10
- # @! Koniec ustawien, reszta kodu tylko do odczytu.
- # @!
- # @!
- #
- #
- #
- stop
- on load:
- message "&7&lAuctions+ zostal przeladowany !" to console
- stop
- on command:
- if command is "money" or "balance":
- if {auc.settings::change-command} is true:
- cancel event
- set {_recieve} to "%{auc.settings::change-command-format}%"
- replace all "{MONEY}" with "%player's balance%" in {_recieve}
- replace all "{PLAYER}" with "%coloured player's displayname%" in {_recieve}
- message "%{_recieve}%"
- stop
- variables:
- {auc.data::auction} = false
- {auc.data::time} = 0
- command /aukcja [<text>] [<text>] [<text>]:
- description: Komendy dot. Auctions+
- permission: auctions.default
- trigger:
- if arg 1 isn't set:
- message "&c&lBledna skladnia. Wpisz: /aukcja pomoc"
- stop
- else:
- if arg 1 is "pomoc":
- message "&8&l================= Auctions+ ================="
- message "&a&lDostepne komendy:"
- message "&7&l /aukcja wystaw [cena] [przedmiot]"
- message "&7&l /aukcja anuluj"
- message "&7&l /aukcja info"
- message "&7&l /aukcja podbij"
- message " "
- message "&a&lAukcje podbija sie +%{auc.settings::raise}% !"
- message "&8&l================= Auctions+ ================="
- stop
- if arg 1 is "wystaw":
- if arg 2 isn't set:
- message "&c&lBledna skladnia. Wpisz: &f&l/aukcja wystaw [cena] [przedmiot]"
- stop
- else:
- if arg 3 isn't set:
- message "&c&lBledna skladnia. Wpisz: &f&l/aukcja wystaw [cena] [przedmiot]"
- stop
- else:
- if arg 2 parsed as number isn't number:
- message "&c&lBladna skladnia. Wpisz: &f&l/aukcja wystaw [cena] [przedmiot]"
- stop
- else:
- set {_item} to arg 3 parsed as items
- if player don't have {_item}:
- message "&c&lBlad. Podany przedmiot nie znajduje sie w twoim ekwipunku. (&f&l%arg 3%&c&l)"
- stop
- else:
- if {auc.data::auction} is true:
- message "&c&lBlad. Trwa juz jedna aukcja ! Poczekaj az sie skonczy. (%{auc.data::time}%s&f&l/&c&l%{auc.settings::time}%s)"
- stop
- else:
- set {auc.temp::owner} to player
- set {auc.temp::item} to arg 3 parsed as items
- set {auc.temp::price} to arg 2 parsed as number
- set {auc.data::time} to 0
- set {auc.data::auction} to true
- remove arg 3 parsed as items from player's inventory
- message "&9&lNowa aukcja ! &a&l%{auc.temp::item}% &7&lza &a&l%{auc.temp::price}% $. &3&lWpisz: /aukcja podbij, aby podbic cene !" to all players
- stop
- if arg 1 is "anuluj":
- if player has permission "auctions.admin":
- if {auc.data::auction} is true:
- give {auc.temp::item} to {auc.temp::owner}'s inventory
- set {auc.data::auction} to false
- delete {auc.temp::owner}
- delete {auc.temp::item}
- delete {auc.temp::price}
- delete {auc.temp::winner}
- set {auc.data::time} to 0
- message "&9&lAukcja anulowana ! &a&lAdministrator przerwal aukcje." to all players
- stop
- else:
- message "&c&lBlad. Aktualnie nie ma zadnej aktywnej aukcji."
- stop
- else:
- if {auc.data::auction} isn't true:
- message "&c&lBlad. Aktualnie nie ma zadnej aktywnej aukcji."
- stop
- else:
- if {auc.temp::owner} isn't "%player%":
- message "&c&lBlad. Nie jestes wlascicielem tej aukcji."
- stop
- else:
- give {auc.temp::item} to player's inventory
- set {auc.data::auction} to false
- delete {auc.temp::owner}
- delete {auc.temp::item}
- delete {auc.temp::price}
- set {auc.data::time} to 0
- message "&9&lAukcja anulowana ! &a&lAukcja uzytkownika &7&l%player% &a&lzostala anulowana." to all players
- stop
- if arg 1 is "info":
- if {auc.data::auction} is true:
- message "&8&l================= Auctions+ ================="
- message "&3&lWlasciciel aukcji: &a&l%{auc.temp::owner}%"
- message "&3&lCena przedmiotu: &a&l%{auc.temp::price}%"
- message "&3&lPrzedmiot aukcji: &a&l%{auc.temp::item}%"
- set {_winner} to "%{auc.temp::winner}%"
- replace all "<none>" with "aktualnie nie ma zadnych chetnych" in {_winner}
- message "&3&lWygrywa: &a&l%{_winner}%"
- message "&3&lCzas aukcji: &a&l%{auc.data::time}%&f&l/&a&l%{auc.settings::time}%"
- message "&8&l================= Auctions+ ================="
- stop
- else:
- message "&c&lBlad. Nie ma aktualnie zadnej aktywnej aukcji."
- stop
- if arg 1 is "podbij":
- if {auc.data::auction} isn't true:
- message "&c&lBlad. Nie ma aktualnie zadnej aktywnej aukcji."
- stop
- else:
- if {auc.temp::owner} isn't player:
- set {_price} to "%{auc.temp::price}%" parsed as number
- if player's money is greater or equal to {_price}+{auc.settings::raise}:
- add {auc.settings::raise} to {auc.temp::price}
- set {auc.temp::winner} to player
- message "&9&lPodbito aukcje ! &a&lAukcja zostala podbita o +%{auc.settings::raise}% przez %player%" to all players
- stop
- else:
- message "&c&lBlad. Posiadasz zbyt malo funduszy ! Wpisz: &a&l/money &c&lpo wiecej informacji"
- set {_min} to {_price}+{auc.settings::raise}
- message "&c&lMinimalna kwota zaliczajaca sie do podbijania stawki to: %{_min}%"
- stop
- else:
- message "&c&lBlad. Nie mozesz podbic wlasnej aukcji !"
- stop
- every 30 seconds:
- if {auc.data::auction} is true:
- if {auc.data::time} isn't {auc.settings::time}:
- add 30 to {auc.data::time}
- message "&9&lTrwa aukcja ! &a&lPo wiecej informacji wpisz: &7&l/aukcja info" to all players
- stop
- else:
- if "%{auc.temp::winner}%" is "<none>" or "aktualnie nie ma zadnych chetnych":
- set {_msg} to {auc.settings::end-fail}
- give {auc.temp::item} to {auc.temp::owner}'s inventory
- replace all "{OWNER}" with "%{auc.temp::owner}%" in {_msg}
- replace all "{PRICE}" with "%{auc.temp::price}%" in {_msg}
- message "%{_msg}%" to all players
- else:
- set {_msg} to {auc.settings::end-success}
- give {auc.temp::item} to {auc.temp::winner}'s inventory
- replace all "{OWNER}" with "%{auc.temp::owner}%" in {_msg}
- replace all "{WINNER}" with "%{auc.temp::winner}%" in {_msg}
- replace all "{PRICE}" with "%{auc.temp::price}%" in {_msg}
- message "%{_msg}%" to all players
- set {auc.data::auction} to false
- delete {auc.temp::owner}
- delete {auc.temp::item}
- delete {auc.temp::price}
- delete {auc.temp::winner}
- set {auc.data::time} to 0
Advertisement
Add Comment
Please, Sign In to add comment