LeFleetz
Gerçeklik inançlarımız doğrultusunda değişir!
- Katılım
- 28 Eylül 2019
- Mesajlar
- 208
- Elmaslar
- 65
- Puan
- 13.725
- Minecraft
- LeFleetz
Discord:
lefleetz
lefleetz
public enum Rank {
OWNER(ChatColor.DARK_RED + "OWNER"),
ADMIN(ChatColor.RED + "ADMIN"),
MOD(ChatColor.GREEN + "MOD"),
MEMBER(null);
private String prefix;
Rank(String prefix) {
this.prefix = prefix;
}
public String getPrefix() {
return prefix;
}
public boolean hasPrefix() {
return prefix != null;
}
}
private static Main instance;
@Override
public void onEnable() {
instance = this;
getDataFolder().mkdirs();
saveDefaultConfig();
}
@Override
public void onDisable() {
saveConfig();
instance = null;
}
public static Main getInstance() {
return instance;
}
private FileConfiguration config = Main.getInstance().getConfig();
public void setRank(Player player, Rank rank) {
config.set("Sıralama" + player.getUniqueId(), rank.toString());
}
public Rank getRank(Player player) {
String val = config.getString("Sıralama" + player.getUniqueId());
return (val == null ? Rank.MEMBER : Rank.valueOf(val));
}
public boolean hasRank(Player player, Rank rank) {
return (getRank(player).compareTo(rank) >= 0);
}
lefleetz
Teşekkürler, ancak bunun skript olduğunu hiç sanmıyorum.Merhaba umarım bu kod işinize yarar, veya ilham kaynağı olur :D
Java:public enum Rank { OWNER(ChatColor.DARK_RED + "OWNER"), ADMIN(ChatColor.RED + "ADMIN"), MOD(ChatColor.GREEN + "MOD"), MEMBER(null); private String prefix; Rank(String prefix) { this.prefix = prefix; } public String getPrefix() { return prefix; } public boolean hasPrefix() { return prefix != null; } } private static Main instance; @Override public void onEnable() { instance = this; getDataFolder().mkdirs(); saveDefaultConfig(); } @Override public void onDisable() { saveConfig(); instance = null; } public static Main getInstance() { return instance; } private FileConfiguration config = Main.getInstance().getConfig(); public void setRank(Player player, Rank rank) { config.set("Sıralama" + player.getUniqueId(), rank.toString()); } public Rank getRank(Player player) { String val = config.getString("Sıralama" + player.getUniqueId()); return (val == null ? Rank.MEMBER : Rank.valueOf(val)); } public boolean hasRank(Player player, Rank rank) { return (getRank(player).compareTo(rank) >= 0); }
Ben plugin sandım pardon,Teşekkürler, ancak bunun skript olduğunu hiç sanmıyorum.burada puan sistemi skripti var. Bu skripti sıralamaya bağlamak istiyorum.Değerli ziyaretçimiz, içeriği görebilmek için şimdi giriş yapın veya kayıt olun.
variables:
{kill::*} = 0
{death::*} = 0
command /ranking:
trigger:
loop {kill::*}:
add 1 to {_size}
if {_low.to.high.list::%loop-value%} is not set:
set {_low.to.high.list::%loop-value%} to loop-index
else:
set {_n} to 0
loop {_size} times:
set {_n} to {_n}+1
{_low.to.high.list::%loop-value-1%.%{_n}%} is not set
set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index
stop loop
wait 1 tick
set {_n} to size of {_low.to.high.list::*}
loop {_low.to.high.list::*}:
set {_high.to.low.list::%{_n}%} to loop-value
set {_n} to {_n}-1
wait 1 tick
set {_i} to 0
#ÜST ÖLÜMLERLE MESAJ
send "&7&m-----------&8< &6Top10 &8>&7&m-----------"
loop {_high.to.low.list::*}:
add 1 to {_topnumber}
set {_player} to "%loop-value%" parsed as offlineplayer
send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value%}% öldürdü"
add 1 to {_i}
if {_topnumber} > 9: #bu ilk 10 değiştirebilirsin
stop
send "&7&m------------------------------"
on death:
if attacker is a player:
if victim is player:
add 1 to {kill::%name of attacker%}
add 1 to {death::%victim%}
add 3 to {gems.%attacker%}
add 1 to attacker's level
else if victim is not a player:
stop
else if attacker is not a player:
broadcast "&cPvP &8» &3Oyuncu %victim% kişi oldürdü!"
add 1 to {death::%victim%}
command /resetstatsall:
permission: reset.stats.of.all.player
permission message: &cKeine Rechte
trigger:
delete {kill::*}
delete {death::*}
command /stats [<offline player>]:
permission: stats.see
permission message: &6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz!
trigger:
if arg-1 is not set:
message "&7&m-----------&r &c&l%player% &r&7&m-----------"
message "&7Öldürme &8➽&c %{kill::%player%}%"
message "&7Ölme &8➽&c %{death::%player%}%"
message "&7KD &8➽&c %{kill::%player%}/{deat::%player%}%"
message "&7&m-----------&r &c&l%player% &r&7&m-----------"
else:
if player have permission "stats.see.others":
set {_player} to arg-1
wait 1 tick
if {_player} has played on this server before:
message "&7&m-----------&r &c&l%{_player}% &r&7&m-----------"
message "&7Öldürme &8➽&c %{kill::%{_player}%}%"
message "&7Ölme &8➽&c %{death::%{_player}%}%"
message "&7KD &8➽&c %{kill::%{_player}%}/{deat::%{_player}%}%"
message "&7&m-----------&r &c&l%{_player}% &r&7&m-----------"
else:
message "&6Stats &8» &r&6&l%{_player}% &cdaha önce bu sunucuda hiç bulunmamıştı!"
else:
message "&6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz!"
command /resetstats [<offlineplayer>]:
permission: stats.reset
permission message: &6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz!
aliases: restats
trigger:
if arg-1 is not set:
message "&cKullanımı: /restats &7(&aOyuncu&7)"
else:
set {_player} to arg-1
wait 1 tick
if {_player} has played on this server before:
set {kill::%arg-1%} to 0
set {death::%arg-1%} to 0
message "&6Stats &8» &6&l%{_player}%&a adlı oyuncunun statı sıfırlandı!"
else:
message "&6Stats &8» &r&6&l%{_player}% &cdaha önce bu sunucuda hiç bulunmamıştı!"
lefleetz
Bu ilk 10'u belirliyor. Ancak mesela /sıralamam yazınca oyuncu kendi sıralamasını nasıl öğrenebilir?Ben plugin sandım pardon,
O zaman buna göz atın derim
JavaScript:variables: {kill::*} = 0 {death::*} = 0 command /ranking: trigger: loop {kill::*}: add 1 to {_size} if {_low.to.high.list::%loop-value%} is not set: set {_low.to.high.list::%loop-value%} to loop-index else: set {_n} to 0 loop {_size} times: set {_n} to {_n}+1 {_low.to.high.list::%loop-value-1%.%{_n}%} is not set set {_low.to.high.list::%loop-value-1%.%{_n}%} to loop-index stop loop wait 1 tick set {_n} to size of {_low.to.high.list::*} loop {_low.to.high.list::*}: set {_high.to.low.list::%{_n}%} to loop-value set {_n} to {_n}-1 wait 1 tick set {_i} to 0 #ÜST ÖLÜMLERLE MESAJ send "&7&m-----------&8< &6Top10 &8>&7&m-----------" loop {_high.to.low.list::*}: add 1 to {_topnumber} set {_player} to "%loop-value%" parsed as offlineplayer send "&7%{_topnumber}% - &c%{_player}% &8» &7%{kill::%loop-value%}% öldürdü" add 1 to {_i} if {_topnumber} > 9: #bu ilk 10 değiştirebilirsin stop send "&7&m------------------------------" on death: if attacker is a player: if victim is player: add 1 to {kill::%name of attacker%} add 1 to {death::%victim%} add 3 to {gems.%attacker%} add 1 to attacker's level else if victim is not a player: stop else if attacker is not a player: broadcast "&cPvP &8» &3Oyuncu %victim% kişi oldürdü!" add 1 to {death::%victim%} command /resetstatsall: permission: reset.stats.of.all.player permission message: &cKeine Rechte trigger: delete {kill::*} delete {death::*} command /stats [<offline player>]: permission: stats.see permission message: &6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz! trigger: if arg-1 is not set: message "&7&m-----------&r &c&l%player% &r&7&m-----------" message "&7Öldürme &8➽&c %{kill::%player%}%" message "&7Ölme &8➽&c %{death::%player%}%" message "&7KD &8➽&c %{kill::%player%}/{deat::%player%}%" message "&7&m-----------&r &c&l%player% &r&7&m-----------" else: if player have permission "stats.see.others": set {_player} to arg-1 wait 1 tick if {_player} has played on this server before: message "&7&m-----------&r &c&l%{_player}% &r&7&m-----------" message "&7Öldürme &8➽&c %{kill::%{_player}%}%" message "&7Ölme &8➽&c %{death::%{_player}%}%" message "&7KD &8➽&c %{kill::%{_player}%}/{deat::%{_player}%}%" message "&7&m-----------&r &c&l%{_player}% &r&7&m-----------" else: message "&6Stats &8» &r&6&l%{_player}% &cdaha önce bu sunucuda hiç bulunmamıştı!" else: message "&6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz!" command /resetstats [<offlineplayer>]: permission: stats.reset permission message: &6Stats &8» &r&cBu komutu yürütmek için gerekli izinlere sahip değilsiniz! aliases: restats trigger: if arg-1 is not set: message "&cKullanımı: /restats &7(&aOyuncu&7)" else: set {_player} to arg-1 wait 1 tick if {_player} has played on this server before: set {kill::%arg-1%} to 0 set {death::%arg-1%} to 0 message "&6Stats &8» &6&l%{_player}%&a adlı oyuncunun statı sıfırlandı!" else: message "&6Stats &8» &r&6&l%{_player}% &cdaha önce bu sunucuda hiç bulunmamıştı!"
Bu ilk 10'u belirliyor. Ancak mesela /sıralamam yazınca oyuncu kendi sıralamasını nasıl öğrenebilir?
/stats isimlefleetz
Yanlış anladınız örneğin sıralamada öldürme sıralamasında 16.'sın gibi/stats isim
papi kodlarından bakabilirsinYanlış anladınız örneğin sıralamada öldürme sıralamasında 16.'sın gibi
lefleetz
tam olarak nereden bakılıyor bu papi kodlarına?papi kodlarından bakabilirsin
Maalesef ki ne kadar araştırsam da, denesem de istediğinizi bulamamdımYanlış anladınız örneğin sıralamada öldürme sıralamasında 16.'sın gibi
Büyük bir topluluğun parçası ol, etkinliklere katıl ve özel hediyeler kazanma şansı yakala!