Advertisement
Guest User

Untitled

a guest
Jul 18th, 2017
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. script options:
  2. $ db url jdbc:mysql://localhost:3306/survivi
  3. $ db username root
  4. $ db password
  5.  
  6. options:
  7. table_prefix: ehc_
  8. refresh: 300
  9. On load:
  10. if {Stats-Reloader} is set:
  11. set {_period} to difference between {Stats-Reload-sec} and now
  12. send "&9SkStats >> &7The skript have been reload in &a%{_period}%" to {Stats-Reloader}
  13. clear {Stats-Reloader}
  14. On script load:
  15. update "CREATE TABLE IF NOT EXISTS `{@table_prefix}Player` (`Player` varchar(255),`Kills` varchar(255),`Deaths` varchar(255))"
  16. On join:
  17. if {firstjoin-%player%} is not set:
  18. set {deaths-%player%} to null
  19. set {kills-%player%} to null
  20. add player to {statslistplayer::*}
  21. set {firstjoin-%player%} to "%now%"
  22. update "INSERT INTO `{@table_prefix}Player` (`Player`, `Kills`, `Deaths`) VALUES ('%player%', '', '')"
  23. On death:
  24. attacker is player
  25. victim is player
  26. add %attacker% to {deaths-%victim%}
  27. add %victim% to {kills-%attacker%}
  28. On death:
  29. attacker is shooter
  30. attacker is player
  31. add %victim% to {kills-%attacker%}
  32. add %attacker% to {deaths-%victim%}
  33. every {@refresh} seconds:
  34. loop all players:
  35. update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Deaths` = `Deaths`+%{deaths-%loop-player%}% WHERE `{@table_prefix}Player`.`Player` = '%loop-player%'"
  36. update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Kills` = `Kills`+%{kills-%loop-player%}% WHERE `{@table_prefix}Player`.`Player` = '%loop-player%'"
  37. On quit:
  38. update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Deaths` = `Deaths`+%{deaths-%player%}% WHERE `{@table_prefix}Player`.`Player` = '%player%'"
  39. update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Kills` = `Kills`+%{kills-%player%}% WHERE `{@table_prefix}Player`.`Player` = '%player%'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement