Files
rangi.sk
Code
1 45
rangi.sk
options:
admin-prefix: &cAdmin
gracz-prefix: &7Gracz
on script load:
execute console command "team add rangi_admin"
execute console command "team modify rangi_admin prefix {\"text\":\"Admin \",\"color\":\"red\"}"
execute console command "team add rangi_gracz"
execute console command "team modify rangi_gracz prefix {\"text\":\"Gracz \",\"color\":\"gray\"}"
loop all players:
if {ranga::%uuid of loop-player%} is "admin":
execute console command "team join rangi_admin %loop-player%"
else:
execute console command "team join rangi_gracz %loop-player%"
on join:
if {ranga::%uuid of player%} is not set:
set {ranga::%uuid of player%} to "gracz"
if {ranga::%uuid of player%} is "admin":
execute console command "team join rangi_admin %player%"
else:
execute console command "team join rangi_gracz %player%"
on chat:
if {ranga::%uuid of player%} is "admin":
set chat format to "{@admin-prefix} &f%player%&7: &f%message%"
else:
set chat format to "{@gracz-prefix} &f%player%&7: &f%message%"
command /ranga <player> <text>:
permission: rangi.admin
permission message: &cNie masz uprawnień do zmiany rang.
trigger:
if arg-2 is "admin":
set {ranga::%uuid of arg-1%} to "admin"
execute console command "team join rangi_admin %arg-1%"
send "&aUstawiono rangę Admin dla gracza &f%arg-1%&a." to player
send "&aOtrzymałeś rangę Admin." to arg-1
else if arg-2 is "gracz":
set {ranga::%uuid of arg-1%} to "gracz"
execute console command "team join rangi_gracz %arg-1%"
send "&aUstawiono rangę Gracz dla gracza &f%arg-1%&a." to player
send "&aTwoja ranga to teraz Gracz." to arg-1
else:
send "&cUżycie: /ranga <gracz> <admin|gracz>" to player