Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # @! Auctions+
- # @! skrypt umozliwiajacy tworzenie
- # @! aukcji na twoim serwerze.
- # @!
- # @! Wymagania:
- # @!
- # @! - Skript
- # @! - iConomy lub Essentials (do ekonomii)
- # @!
- # @! Uprawnienia:
- # @!
- # @! (podstawowe)
- # @!
- # @! - auctions.create (tworzenie aukcji)
- # @! - auctions.cancel (anulowanie aukcji)
- # @! - auctions.active (informacje aukcji)
- # @! - auctions.raise (podbicie stawki)
- # @!
- # @! (ponadpodstawowe)
- # @!
- # @! - auctions.cancel.admin (anulowanie aukcji bez wymagania byciem jej wlascicielem)
- # @!
- # @! Komendy:
- # @!
- # @! - /aukcja wystaw [cena] [przedmiot np. 3 emeralds]
- # @! - /aukcja podbij
- # @! - /aukcja info
- # @! - /aukcja anuluj
- # @! - /aukcja pomoc
- # @!
- # @! Aukcje podbija sie o +5
- # @!
- # @! Autor: krzysek
- # @! Wersja: 0.2
- # @!
- # @! Koniec ustawien, reszta kodu jest tylko do odczytu.
- # @!
- #
- #
- #
- variables:
- {auctions.exists} = false
- {auctions.time} = 0
- command /aukcja [<text>] [<text>] [<text>]:
- aliases: auc++
- description: Aukcja commands ! :D
- trigger:
- if arg 1 isn't set:
- message "&3* { -- } --- > &f&lAuctions&4&l++ &3< --- { -- } *"
- message " "
- message "&4+--> &f&l/aukcja wystaw [cena np. 20] [item np. 3 emerald] &c- &6Tworzy aukcje."
- message " "
- message "&4+--> &f&l/aukcja anuluj &c- &6Anuluje aukcje."
- message " "
- message "&4+--> &f&l/aukcja info &c- &6Info. na temat aktualnej aukcji."
- message " "
- message "&4+--> &f&l/aukcja podbij &c- &6Podbija cene."
- message " "
- message "&4+--> &f&l/aukcja pomoc &c- &6Komendy/opis."
- message " "
- message "&3* { -- } --- > &f&lAuctions&4&l++ &3< --- { -- } *"
- stop
- else:
- if arg 1 is "pomoc":
- message "&3* { -- } --- > &f&lAuctions&4&l++ &3< --- { -- } *"
- message " "
- message "&4+--> &f&l/aukcja wystaw [cena np. 20] [item np. 3 emerald] &c- &6Tworzy aukcje."
- message " "
- message "&4+--> &f&l/aukcja anuluj &c- &6Anuluje aukcje."
- message " "
- message "&4+--> &f&l/aukcja info &c- &6Info. na temat aktualnej aukcji."
- message " "
- message "&4+--> &f&l/aukcja podbij &c- &6Podbija cene."
- message " "
- message "&4+--> &f&l/aukcja pomoc &c- &6Komendy/opis."
- message " "
- message "&3* { -- } --- > &f&lAuctions&4&l++ &3< --- { -- } *"
- stop
- if arg 1 is "wystaw":
- if player has permission "auctions.create":
- if arg 2 isn't set:
- message "&f&lAukcja &c/aukcja wystaw [cena np. 20] [item]"
- stop
- else:
- if arg 3 isn't set:
- message "&f&lAukcja &c/aukcja wystaw [cena np. 20] [item]"
- stop
- else:
- set {_item} to arg 3 parsed as items
- if player don't have {_item}:
- message "&f&lAukcja &cNie posiadasz: %{_item}% !"
- stop
- else:
- set {_price} to "%arg 2%"
- if {_price} contains "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9":
- if {_price} contains "/" or "*" or "!" or "\" or "|" or "<" or ">" or "[" or "]" or "a" or "b" or "c" or "d" or "e" or "f" or "g" or "h" or "i" or "j" or "k" or "r" or "s" or "w" or "t":
- message "&f&lAukcja &cArgument 2 nie moze zawierac znakow specialnych i liter !"
- stop
- else:
- if {auctions.exists} is true:
- message "&f&lAukcja &cInna aukcja jest juz wystawiona ! Poczekaj na jej zakonczenie."
- stop
- else:
- if {_item} is air:
- message "&f&lAukcja &cNie mozesz sprzedac powietrza !"
- stop
- else:
- set {_remove} to arg 3 parsed as items
- if "%{_remove}%" is "<none>":
- message "&f&lAukcja &c%arg 3% nie jest przedmiotem !"
- stop
- else:
- remove {_remove} from player's inventory
- set {auctions.exists} to true
- set {auctions.creator} to "%player%"
- set {auctions.forsale} to "%arg 3%"
- set {auctions.price} to "%arg 2%"
- message "&c&l%player% &9utworzyl aukcje ! Przedmiot do kupna: &f%{_remove}% &9Cena: &f&l%{auctions.price}% &cPo 2 minutach aukcja zostanie automatycznie zakonczona." to all players
- message "&c&lWpisz: &f/aukcja podbij &caby podbic cene o +5 !"
- stop
- else:
- message "&f&lAukcja &cArgument 2 nie jest cyfra (np. 20)"
- stop
- else:
- message "&4Nie posiadasz do tego uprawnien."
- stop
- if arg 1 is "anuluj":
- if player has permission "auctions.cancel":
- if {auctions.exists} is false:
- message "&f&lAukcja &cAktualnie nie ma zadnej aukcji."
- stop
- else:
- set {_player} to "%player%"
- if {auctions.creator} isn't "%{_player}%":
- if player has permission "auctions.cancel.admin":
- set {auctions.exists} to false
- set {_add} to "%{auctions.forsale}%"
- set {_ad} to "%{_add}%" parsed as items
- add {_ad} to player
- wait 1 second
- set {auctions.time} to 0
- delete {auctions.exists.leader}
- delete {auctions.creator}
- delete {auctions.forsale}
- delete {auctions.price}
- message "&c&l%player% &9anulowal aukcje ! Nie jest juz ona aktywna." to all players
- stop
- else:
- message "&f&lAukcja &cNie jestes wlascicielem tej aukcji !"
- stop
- else:
- set {auctions.exists} to false
- set {_add} to "%{auctions.forsale}%"
- set {_ad} to "%{_add}%" parsed as items
- add {_ad} to player
- wait 1 second
- set {auctions.time} to 0
- delete {auctions.exists.leader}
- delete {auctions.creator}
- delete {auctions.forsale}
- delete {auctions.price}
- message "&c&l%player% &9anulowal aukcje ! Nie jest juz ona aktywna." to all players
- stop
- else:
- message "&4Nie posiadasz do tego uprawnien."
- stop
- if arg 1 is "info":
- if player has permission "auctions.active":
- if {auctions.exists} is false:
- message "&f&lAukcja &cAktualnie nie ma zadnej aukcji."
- stop
- else:
- set {_creator} to "%{auctions.creator}%"
- set {_item} to "%{auctions.forsale}%" parsed as items
- set {_price} to "%{auctions.price}%"
- message "&f&l-- Auctions ++ --"
- message "&cWlasciciel: &6%{_creator}%"
- message "&cPrzedmiot: &6%{_item}%"
- message "&cCena: &6%{_price}%"
- message "&cCzas: &6%{auctions.time}%&f/&9200 &6sec."
- message "&f&l-- Auctions ++ --"
- stop
- else:
- message "&4Nie posiadasz do tego uprawnien."
- stop
- if arg 1 is "podbij":
- if player has permission "auctions.raise":
- if {auctions.exists} is false:
- message "&f&lAukcja &cAktualnie nie ma zadnej aukcji."
- stop
- else:
- set {_creator} to "%{auctions.creator}%"
- if {_creator} is "%player%":
- message "&f&lAukcja &cNie mozesz podbijac ceny swojej aukcji !"
- stop
- else:
- set {_price} to "%{auctions.price}%" parsed as number
- if player's money is greater or equal to {_price}+{auctions.data.raise}:
- set {auctions.price} to {_price} + {auctions.data.raise}
- set {auctions.exists.leader} to "%player%"
- message "&f&lAukcja &c&l%player% &6podbija cene o +5 ! (Akt. cena: &f%{auctions.price}% &6)" to all players
- stop
- else:
- message "&f&lAukcja &cNie masz tyle pieniedzy !"
- stop
- Every 1 seconds:
- if {auctions.exists} is true:
- add 1 to {auctions.time}
- if {auctions.time} is 195:
- message "&c&l%{auctions.creator}% &9Czas do konca aukcji: &65 seconds" to all players
- if {auctions.time} is 196:
- message "&c&l%{auctions.creator}% &9Czas do konca aukcji: &64 seconds" to all players
- if {auctions.time} is 197:
- message "&c&l%{auctions.creator}% &9Czas do konca aukcji: &63 seconds" to all players
- if {auctions.time} is 198:
- message "&c&l%{auctions.creator}% &9Czas do konca aukcji: &62 seconds" to all players
- if {auctions.time} is 199:
- message "&c&l%{auctions.creator}% &9Czas do konca aukcji: &61 seconds" to all players
- if {auctions.time} is 200:
- set {_wygral} to "%{auctions.exists.leader}%"
- if {_wygral} is "<none>":
- set {_add} to "%{auctions.forsale}%"
- set {_ad} to "%{_add}%" parsed as items
- set {_creator} to "%{auctions.creator}%" parsed as player
- add {_ad} to {_creator}
- message "&c&l%{auctions.creator}% &9Aukcja zakonczona ! Nie bylo zadnego chetnego do kupna..." to all players
- wait 1 second
- set {auctions.exists} to false
- set {auctions.time} to 0
- delete {auctions.exists.leader}
- delete {auctions.creator}
- delete {auctions.price}
- delete {auctions.forsale}
- stop
- else:
- set {_price} to "%{auctions.price}%"
- set {_pric} to "%{_price}%" parsed as number
- execute console command "money take %{auctions.exists.leader}% %{_pric}%"
- execute console command "money give %{auctions.creator}% %{_pric}%"
- set {_add} to "%{auctions.forsale}%"
- set {_ad} to "%{_add}%" parsed as items
- set {_winner} to "%{auctions.exists.leader}%"
- set {_winne} to "%{_winner}%" parsed as player
- add {_ad} to {_winne}
- message "&c&l%{auctions.creator}% &9Aukcja zakonczona ! Aukcje wygral: &c&l%{auctions.exists.leader}%" to all players
- wait 1 second
- set {auctions.exists} to false
- set {auctions.time} to 0
- delete {auctions.exists.leader}
- delete {auctions.creator}
- delete {auctions.price}
- delete {auctions.forsale}
- stop
- Every 1 minutes:
- if {auctions.exists} is true:
- set {_creator} to "%{auctions.creator}%"
- set {_price} to "%{auctions.price}%"
- set {_forsale} to "%{auctions.forsale}%" parsed as items
- message "&c&l%{_creator}% &9aukcja ! Przedmiot do kupna: &6%{_forsale}% &9Cena: &6%{_price}%" to all players
- message "&c&lWpisz: &f/aukcja podbij &caby podbic cene o +5 !" to all players
- stop
Advertisement
Add Comment
Please, Sign In to add comment