Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- script options:
- $ db url jdbc:mysql://localhost:3306/survivi
- $ db username root
- $ db password
- options:
- table_prefix: ehc_
- refresh: 300
- On load:
- if {Stats-Reloader} is set:
- set {_period} to difference between {Stats-Reload-sec} and now
- send "&9SkStats >> &7The skript have been reload in &a%{_period}%" to {Stats-Reloader}
- clear {Stats-Reloader}
- On script load:
- update "CREATE TABLE IF NOT EXISTS `{@table_prefix}Player` (`Player` varchar(255),`Kills` varchar(255),`Deaths` varchar(255))"
- On join:
- if {firstjoin-%player%} is not set:
- set {deaths-%player%} to null
- set {kills-%player%} to null
- add player to {statslistplayer::*}
- set {firstjoin-%player%} to "%now%"
- update "INSERT INTO `{@table_prefix}Player` (`Player`, `Kills`, `Deaths`) VALUES ('%player%', '', '')"
- On death:
- attacker is player
- victim is player
- add %attacker% to {deaths-%victim%}
- add %victim% to {kills-%attacker%}
- On death:
- attacker is shooter
- attacker is player
- add %victim% to {kills-%attacker%}
- add %attacker% to {deaths-%victim%}
- every {@refresh} seconds:
- loop all players:
- update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Deaths` = `Deaths`+%{deaths-%loop-player%}% WHERE `{@table_prefix}Player`.`Player` = '%loop-player%'"
- update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Kills` = `Kills`+%{kills-%loop-player%}% WHERE `{@table_prefix}Player`.`Player` = '%loop-player%'"
- On quit:
- update "UPDATE `{@table_prefix}Player` SET `{@table_prefix}Player`.`Deaths` = `Deaths`+%{deaths-%player%}% WHERE `{@table_prefix}Player`.`Player` = '%player%'"
- 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