Files
czek.sk
Code
1 95
czek.sk
# System Czeków
# Umieść w plugins/Skript/scripts/
# Przeładuj komendą /sk reload czek
options:
prefix: &6&l[CZEK]&r
command /czek [<integer>]:
trigger:
if arg-1 is not set:
send "{@prefix} &cUżycie: /czek <kwota>" to player
stop
if arg-1 <= 0:
send "{@prefix} &cKwota musi być większa niż 0!" to player
stop
if balance of player < arg-1:
send "{@prefix} &cNie masz wystarczająco pieniędzy! Masz: &e%balance of player%$" to player
stop
remove arg-1 from balance of player
set {_czek} to paper named "&6&lCZEK &8» &e%arg-1%$"
set line 1 of lore of {_czek} to "&7Wartość: &e%arg-1% monet"
set line 2 of lore of {_czek} to "&7Wystawca: &f%player%"
set line 3 of lore of {_czek} to ""
set line 4 of lore of {_czek} to "&aKliknij PPM aby zrealizować!"
give {_czek} to player
send "{@prefix} &aWystawiono czek na &e%arg-1%$&a!" to player
command /czekdaj <player> <integer>:
permission: czek.admin
trigger:
if arg-1 is not set:
send "{@prefix} &cUżycie: /czekdaj <gracz> <kwota>" to player
stop
if arg-2 is not set:
send "{@prefix} &cUżycie: /czekdaj <gracz> <kwota>" to player
stop
if arg-2 <= 0:
send "{@prefix} &cKwota musi być większa niż 0!" to player
stop
set {_czek} to paper named "&6&lCZEK &8» &e%arg-2%$"
set line 1 of lore of {_czek} to "&7Wartość: &e%arg-2% monet"
set line 2 of lore of {_czek} to "&7Wystawca: &cADMIN"
set line 3 of lore of {_czek} to ""
set line 4 of lore of {_czek} to "&aKliknij PPM aby zrealizować!"
give {_czek} to arg-1
send "{@prefix} &aDano graczowi &e%arg-1% &aczek na &e%arg-2%$&a!" to player
send "{@prefix} &aOtrzymałeś czek na &e%arg-2%$&a od admina!" to arg-1
on right click:
if player's tool is paper:
if name of player's tool contains "CZEK":
cancel event
set {_name} to name of player's tool
replace all "&6&lCZEK &8» &e" and "$" with "" in {_name}
replace all "&" with "" in {_name}
replace all "6lCZEK 8 e" with "" in {_name}
set {_kwota} to {_name} parsed as integer
if {_kwota} is set:
if {_kwota} > 0:
add {_kwota} to balance of player
remove 1 of player's tool from player
send "{@prefix} &aZrealizowano czek! Otrzymano &e%{_kwota}%$&a!" to player
send "{@prefix} &7Twoje saldo: &e%balance of player%$" to player
else:
send "{@prefix} &cBłędna kwota na czeku!" to player
else:
send "{@prefix} &cNie można odczytać kwoty z czeku!" to player
command /saldo:
aliases: /balance, /bal, /pieniadze
trigger:
send "{@prefix} &7Twój stan konta: &e%balance of player%$" to player
command /pay <player> <integer>:
aliases: /zaplac
trigger:
if arg-1 is not set:
send "{@prefix} &cUżycie: /pay <gracz> <kwota>" to player
stop
if arg-2 is not set:
send "{@prefix} &cUżycie: /pay <gracz> <kwota>" to player
stop
if arg-2 <= 0:
send "{@prefix} &cKwota musi być większa niż 0!" to player
stop
if balance of player < arg-2:
send "{@prefix} &cNie masz wystarczająco pieniędzy!" to player
stop
if arg-1 is player:
send "{@prefix} &cNie możesz wysłać pieniędzy sam sobie!" to player
stop
remove arg-2 from balance of player
add arg-2 to balance of arg-1
send "{@prefix} &aWysłano &e%arg-2%$ &ado &e%arg-1%&a!" to player
send "{@prefix} &aOtrzymano &e%arg-2%$ &aod &e%player%&a!" to arg-1