Guest User

Untitled

a guest
Aug 22nd, 2014
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Author: TheFallingCookie - http://skript.pl/index.php?/user/130-thefallingcookie/
  2. # Name: psRanking
  3. # Version: 1.0
  4.  
  5. variables:
  6.     {battle::%player%} = -1
  7.  
  8. on load:
  9.     send "[psRanking] Succesfully loaded." to the console
  10.     send "[psRanking] Developed by TheFallingCookie." to the console
  11.     execute console command "scoreboard objectives add pkt dummy &7pkt"
  12.     execute console command "scoreboard objectives setdisplay belowName pkt"
  13.     loop all players:
  14.         kick loop-player due to "&7Wejdz ponownie na serwer!"
  15. on unload:
  16.     execute console command "scoreboard objectives remove pkt"
  17. on join:
  18.     set {battle::%player%} to -1
  19.     {punkty::%player%} is not set:
  20.         set {punkty::%player%} to 1000
  21.     {zabojstwa.%player%} is not set:
  22.         set {zabojstwa.%player%} to 0
  23.     {smierci.%player%} is not set:
  24.         set {smierci.%player%} to 0
  25.     execute console command "scoreboard players set %player% pkt %{punkty::%player%}%"
  26.     set {_x} to name of player
  27.     if {_x} is "TheFallingCookie":
  28.         send "&8> &7Na tym serwerze znajduje sie skrypt &6psRanking &7by TheFallingCookie"
  29. on death of player:
  30.     set {battle::%victim%} to 0
  31.     set {battle::%attacker%} to 0
  32.     strike lightning effect at the player
  33.     {atakujacy.%victim%} is set:
  34.         set {_attacker.%victim%} to {atakujacy.%victim%}
  35.         drop victim's skull at location of victim
  36.         add 1 to {smierci.%victim%}
  37.         add 1 to {zabojstwa.%{_attacker}%}
  38.         set {_punkty.%victim%} to rounded down {punkty::%victim%}*0.10
  39.         add {_punkty.%victim%} to {punkty::%{_attacker.%victim%}%}
  40.         remove {_punkty.%victim%} from {punkty::%victim%}
  41.         set death message to "&8> &6%victim% &czostal zabity przez &6%{_attacker.%victim%}% &7(&6+%{_punkty.%victim%}%&7)"
  42.         execute console command "scoreboard players set %victim% pkt %{punkty::%victim%}%"
  43.         execute console command "scoreboard players set %{_attacker.%victim%}% pkt %{punkty::%{_attacker.%victim%}%}%"
  44.         delete {atakujacy.%victim%}
  45.         stop
  46.     {atakujacy.%victim%} is not set:
  47.         add 1 to {smierci.%victim%}
  48.         remove 30 from {punkty::%victim%}
  49.         execute console command "scoreboard players set %victim% pkt %{punkty::%victim%}%"
  50.         stop
  51. on quit:
  52.     if {atakujacy.%player%} is set:
  53.         set {_attacker.%player%} to {atakujacy.%player%}
  54.         delete {atakujacy.%player%}
  55.         kill player
  56.         drop player's skull at location of player
  57.         add 1 to {smierci.%player%}
  58.         add 1 to {zabojstwa.%{_attacker.%player%}%}
  59.         set {_punkty.%player%} to rounded down {punkty::%player%}*0.10
  60.         add {_punkty.%player%} to {punkty::%{_attacker.%player%}%}
  61.         remove {_punkty.%player%} from {punkty::%player%}
  62.         broadcast "&8> &6%player% wylogowal sie podczas walki!"
  63.         broadcast "&8> &6%player% &czostal zabity przez &6%{_attacker.%player%}% &7(&6+%{_punkty.%player%}%&7)"
  64.         execute console command "scoreboard players set %player% pkt %{punkty::%player%}%"
  65.         execute console command "scoreboard players set %{_attacker.%player%}% pkt %{punkty::%{_attacker.%player%}%}%"
  66.         delete {atakujacy.%player%}
  67.  
  68. every 1 second:
  69.     loop all players:
  70.         if {battle::%loop-player%} is not more than 0:
  71.             add -1 to {battle::%loop-player%}
  72.         if {battle::%loop-player%} is 0:
  73.             send "&aOkres PVP mina, mozesz sie wylogowac." to loop-player
  74.             add -1 to {battle::%loop-player%}
  75.  
  76. on damage of player:
  77.     {punkty::%attacker%} is set:
  78.         if {battle::%victim%} is -1:
  79.             send "&cZaczoles PVP, pamietaj nie mozesz sie wylogowac!" to victim
  80.         if {battle::%attacker%} is -1:
  81.             send "&cZaczoles PVP, pamietaj nie mozesz sie wylogowac!" to attacker
  82.         set {battle::%victim%} to 10
  83.         set {battle::%attacker%} to 10
  84.         set {atakujacy.%victim%} to name of attacker
  85.         wait 15 seconds
  86.         delete {atakujacy.%victim%}
  87. command /gracz [<offline player=%player%>]:
  88.     description: Pozwala na sprawdzenie rankingu innego gracza
  89.     trigger:
  90.         if arg is set:
  91.             {punkty::%arg%} is set:
  92.                 send "&8> &7Ranking gracza: &6%arg%"
  93.                 send "&8> &7Punkty: &6%{punkty::%arg%}%"
  94.                 send "&8> &7Zabojstwa: &6%{zabojstwa.%arg%}%"
  95.                 send "&8> &7Smierci: &6%{smierci.%arg%}%"
  96.             {punkty::%arg%} is not set:
  97.                 send "&8> &cGracza o takim nicku nie ma w bazie danych!"
  98.             stop
  99.         else:
  100.             send "&8> &7Ranking gracza: &6%player% &7(Ty)"
  101.             send "&8> &7Punkty: &6%{punkty::%player%}%"
  102.             send "&8> &7Zabojstwa: &6%{zabojstwa.%player%}%"
  103.             send "&8> &7Smierci: &6%{smierci.%player%}%"
  104. command /top10:
  105.     description: Top 10 graczy z najwyzsza iloscia punktow
  106.     aliases: /top, /topka
  107.     trigger:
  108.         send "&8> &6Top 10 najlepszych graczy:"
  109.         set {_num} to size of {punkty::*}
  110.         loop {_num} times:
  111.             loop {punkty::*}:
  112.                 {_v.%loop-number%} is not set:
  113.                     set {_v.%loop-number%} to loop-value
  114.                     set {_n.%loop-number%} to loop-index
  115.                 loop-value is greater than {_v.%loop-number%}:
  116.                     set {_v.%loop-number%} to loop-value
  117.                     set {_n.%loop-number%} to loop-index
  118.             remove {_v.%loop-number%} from {punkty::*}
  119.         loop {_num} times:
  120.             loop-number is less than or equal to 10:
  121.                 send "&8> &7%loop-number%. &6%{_n.%loop-number%}% &8(&6%{_v.%loop-number%}%&8)"
  122.             set {punkty::%{_n.%loop-number%}%} to {_v.%loop-number%}
  123. command /ranking [<text>] [<player>] [<integer>]:
  124.     description: Pozwala na zarzadzanie rankingiem innego gracza
  125.     trigger:
  126.         if player has permission "psranking.*":
  127.             arg 1 is not set:
  128.                 send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  129.             arg 1 is not "set" or "add" or "remove":
  130.                 send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  131.             arg 1 is "set":
  132.                 if arg 2 is set:
  133.                     if arg 3 is set:
  134.                         if {punkty::%arg 2%} is set:
  135.                             set {punkty::%arg 2%} to arg 3
  136.                             send "&8> &7Zaaktualizowano ranking gracza: &6%arg 2%&7!"
  137.                             execute console command "scoreboard players set %arg 2% pkt %{punkty::%arg 2%}%"
  138.                         else:
  139.                             send "&8> &cGracza o takim nicku nie ma w bazie danych!"
  140.                     else:
  141.                         send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  142.                 else:
  143.                     send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  144.             arg 1 is "add":
  145.                 if arg 2 is set:
  146.                     if arg 3 is set:
  147.                         if {punkty::%arg 2%} is set:
  148.                             add arg 3 to {punkty::%arg 2%}
  149.                             send "&8> &7Zaaktualizowano ranking gracza: &6%arg 2%&7!"
  150.                             execute console command "scoreboard players set %arg 2% pkt %{punkty::%arg 2%}%"
  151.                         else:
  152.                             send "&8> &cGracza o takim nicku nie ma w bazie danych!"
  153.                     else:
  154.                         send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  155.                 else:
  156.                     send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  157.             arg 1 is "remove":
  158.                 if arg 2 is set:
  159.                     if arg 3 is set:
  160.                         if {punkty::%arg 2%} is set:
  161.                             remove arg 3 from {punkty::%arg 2%}
  162.                             send "&8> &7Zaaktualizowano ranking gracza: &6%arg 2%&7!"
  163.                             execute console command "scoreboard players set %arg 2% pkt %{punkty::%arg 2%}%"
  164.                         else:
  165.                             send "&8> &cGracza o takim nicku nie ma w bazie danych!"
  166.                     else:
  167.                         send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  168.                 else:
  169.                     send "&8> &cPrawidlowe uzycie: &6/ranking &7<&6set|add|remove&7> <&6gracz&7> <&6ilosc>&7"
  170.             stop
  171.         else:
  172.             send "&8> &cNie masz uprawnien do uzywania tej komendy! &7(&6psranking.*&7)"
Advertisement
Add Comment
Please, Sign In to add comment