Menü
💬 Forum 🛒 Mağaza ⛏️ Sunucular ⚔️ Klanlar 📰 Blog 🏆 Liderlik 👥 Üyeler 🎖️ Rütbeler
1 üye online 👥 12 toplam üye 📝 Bugün 51 konu 💬 Bugün 51 mesaj

Skript ile Ücretsiz Oyuncu İstatistikleri Sistemi — Kill Death Ratio

orginscorel · 2 saat önce · 1 gönderi · 0 görüntülenme
#1

Oyuncu İstatistikleri Skripti — Kill Death Ratio ve Sıralama



PvP sunucuları için kill/death istatistiklerini tutan, KDR hesaplayan ve liderlik tablosu gösteren kapsamlı bir istatistik sistemi.

Tam Skript Kodu




# istatistik.sk
# Oyuncu İstatistikleri Sistemi — Ücretsiz

options:
prefix: "&8[&c&l⚔ İstat&8] &r"

on death:
victim is a player
add 1 to {istat.olum::%victim's uuid%}
if attacker is a player:
add 1 to {istat.kill::%attacker's uuid%}
add 10 to {istat.puan::%attacker's uuid%}
# Kill mesajı
send "{@prefix}&e%attacker% &7→ &c%victim% &7(Kill: &e%{istat.kill::%attacker's uuid%}%&7)" to attacker
send "{@prefix}&7+10 puan! Toplam: &e%{istat.puan::%attacker's uuid%}%" to attacker
else:
# Çevre hasarı vb.
add 5 to {istat.puan::%victim's uuid%}

on join:
if {istat.kill::%player's uuid%} is not set:
set {istat.kill::%player's uuid%} to 0
if {istat.olum::%player's uuid%} is not set:
set {istat.olum::%player's uuid%} to 0
if {istat.puan::%player's uuid%} is not set:
set {istat.puan::%player's uuid%} to 0

function getKDR(uuid: text) :: number:
set {_k} to {istat.kill::%{_uuid}%} ? 0
set {_d} to {istat.olum::%{_uuid}%} ? 1
if {_d} is 0:
return {_k}
return floor(({_k} / {_d}) * 100) / 100

command /istat [<player>]:
trigger:
set {_p} to arg-1 ? player
set {_kill} to {istat.kill::%{_p}'s uuid%} ? 0
set {_olum} to {istat.olum::%{_p}'s uuid%} ? 0
set {_puan} to {istat.puan::%{_p}'s uuid%} ? 0
set {_kdr} to getKDR({_p}'s uuid)
send "" to player
send "&c--- ⚔ %{_p}% İstatistikleri ---" to player
send "&7Kill: &a%{_kill}%" to player
send "&7Ölüm: &c%{_olum}%" to player
send "&7KDR: &e%{_kdr}%" to player
send "&7Puan: &6%{_puan}%" to player
send "" to player

command /killsıra:
aliases: /toppvp, /pvplider
trigger:
send "&c--- ⚔ PvP Liderlik ---" to player
set {_sira} to 1
# Basit sıralama — büyük sunucularda yavaş olabilir
set {_max} to 10
set {_islendi::*} to {}
loop {_max} times:
set {_en-cok} to 0
set {_en-uuid} to ""
loop indices {istat.kill::*}:
if {_islendi::%loop-value-2%} is not set:
if {istat.kill::%loop-value-2%} > {_en-cok}:
set {_en-cok} to {istat.kill::%loop-value-2%}
set {_en-uuid} to loop-value-2
if {_en-uuid} is "":
stop loop
set {_islendi::%{_en-uuid}%} to true
set {_p} to {_en-uuid} parsed as offline player
set {_kdr} to getKDR({_en-uuid})
send "&7%{_sira}%. &f%{_p}% &8| &aKill: %{_en-cok}% &8| &eKDR: %{_kdr}%" to player
add 1 to {_sira}

command /istattemizle <player>:
permission: istat.admin
trigger:
delete {istat.kill::%arg-1's uuid%}
delete {istat.olum::%arg-1's uuid%}
delete {istat.puan::%arg-1's uuid%}
send "{@prefix}&a%arg-1% istatistikleri sıfırlandı." to player

command /istatekle <player> kill|olum|puan <number>:
permission: istat.admin
trigger:
if arg-2 is "kill":
add arg-3 to {istat.kill::%arg-1's uuid%}
else if arg-2 is "olum":
add arg-3 to {istat.olum::%arg-1's uuid%}
else if arg-2 is "puan":
add arg-3 to {istat.puan::%arg-1's uuid%}
send "{@prefix}&a%arg-1% %arg-2% +%arg-3% eklendi." to player


Liderlik Tablosu İyileştirmesi



Büyük sunucularda loop with sıralama yavaş olabilir. Alternatif olarak her öldürmede listeyi güncelleme:


on death:
victim is a player
attacker is a player
add 1 to {istat.kill::%attacker's uuid%}
# Top 10'u güncelle
set {top10.%attacker's uuid%} to {istat.kill::%attacker's uuid%}


Sorularınız için bu konuya yazın!

Cevap yazabilmek için giriş yap.