Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #-----------------
- # Auteur : cercus
- # Version : 1.0
- # Description : Skript de coins pour tout le serveur AdventSky
- #-----------------
- # MODIFIER LA DATABASE
- script options:
- $ db url jdbc:mysql://localhost:3306/<db_name>
- $ db username <username>
- $ db password <mdp>
- options:
- refresh: 300
- table_prefix: Coins_
- On load:
- if {Stats-Reloader} is set:
- set {_period} to difference between {Stats-Reload-sec} and now
- send "&3Coins &9» &7Le skript a été rechargé en &a%{_period}%" to {Stats-Reloader}
- clear {Stats-Reloader}
- On skript load:
- update "CREATE TABLE IF NOT EXISTS '{@table_prefix}Player' ('Player' varchar(255),'Coins' varchar(255))"
- send "&2&l[&a&lCoins&2&l] &eLA database a été update" to player
- On join:
- if {firstjoin-%player%} is not set:
- set {coins.%player%} to 0
- add player to {coinslistplayer::*}
- set {firstjoin-%player%} to "%now%"
- update "INSERT INTO '{@table_prefix}Player' ('Player', 'Coins', 'FirstJoin') VALUES ('%player%', '0','%now%',)"
- command /coins [<text>] [<offline player>] [<integer>]:
- trigger:
- if arg-1 is "help":
- send "&3&l=&9&l=&3&l=&9&l=&3&l=&9&l= &2&l[&a&lCoins&2&l] &3&l=&9&l=&3&l=&9&l=&3&l=&9&l=" to player
- send "" to player
- send "&9/coins help : &7Affiche les commandes disponibles" to player
- send "&9/coins view <player> : &7Affiche le nombre de coins du joueur" to player
- if player has permission "coins.admin":
- send "&9/coins add <player> <nombre> : &7Ajouter des coins au joueur" to player
- send "&9/coins remove <player> <nombre> : &7Enlever des coins au joueur" to player
- send "&9/coins set <player> <nombre> : &7Mettre un nombre defini de coins au joueur" to player
- send "&9/coins purge : &7Purge la DB et reset les variables" to player
- send "&9/coins sync : &7Synchronise les coins avec la database" to player
- send "&9/coins reload : &7Reload le skript de coins" to player
- if arg-1 is "view":
- if arg-2 is not online:
- send "&2&l[&a&lCoins&2&l] &cCe joueur n'est pas en ligne" to player
- if arg-2 is online:
- send "&2&l[&a&lCoins&2&l] &aNombre de coins de %arg-2% : %{coins.%arg-2%}% coins" to player
- if arg-1 is "reload":
- set {Stats-Reload-sec} to now
- set {Stats-Reloader} to player
- make console execute command "/skript reload Coins.sk"
- if arg-1 is "purge":
- if player has permission "coins.admin":
- loop {coinslistplayer::*}:
- set {coins.%loop-value%} to 0
- update "TRUNCATE TABLE '{@table_prefix}Player'"
- if arg-1 is "sync":
- if player has permission "coins.admin":
- loop all players:
- update "UPDATE '{@table_prefix}Player' SET '{@table_prefix}Player'.'Coins' = 'Coins'+%{coins.%loop-player%}% WHERE '{@table_prefix}Player'.'Player' = '%loop-player%'"
- send "&2&l[&a&lCoins&2&l] &eLa DB a été synchronisé avec les variables" to player
- if arg-1 is "add":
- if arg-2 is not online:
- send "&2&l[&a&lCoins&2&l] &cCe joueur n'est pas en ligne" to player
- if arg-2 is online:
- if arg-3 is set:
- if player has permission "coins.admin":
- add arg-3 to {coins.%arg-2%}
- update "UPDATE '{@table_prefix}Player' SET '{@table_prefix}Player'.'Coins' = 'Coins'+%{coins.%arg-2%}% WHERE '{@table_prefix}Player'.'Player' = '%arg-2%'"
- send "&2&l[&a&lCoins&2&l] &eVous avez ajouté %arg-3% à %arg-2% : Il a maintenant %{coins.%arg-2%}%"
- else:
- send "&2&l[&a&lCoins&2&l] &cVous n'avez pas la permission" to player
- if arg-1 is "remove":
- if arg-2 is not online:
- send "&2&l[&a&lCoins&2&l] &cCe joueur n'est pas en ligne" to player
- if arg-2 is online:
- if arg-3 is set:
- if player has permission "coins.admin":
- remove arg-3 from {coins.%arg-2%}
- update "UPDATE '{@table_prefix}Player' SET '{@table_prefix}Player'.'Coins' = 'Coins'+%{coins.%arg-2%}% WHERE '{@table_prefix}Player'.'Player' = '%arg-2%'"
- send "&2&l[&a&lCoins&2&l] &eVous avez enlevé %arg-3% à %arg-2% : Il a maintenant %{coins.%arg-2%}%"
- else:
- send "&2&l[&a&lCoins&2&l] &cVous n'avez pas la permission" to player
- if arg-1 is "set":
- if arg-2 is not online:
- send "&2&l[&a&lCoins&2&l] &cCe joueur n'est pas en ligne" to player
- if arg-2 is online:
- if arg-3 is set:
- if player has permission "coins.admin":
- set arg-3 to {coins.%arg-2%}
- update "UPDATE '{@table_prefix}Player' SET '{@table_prefix}Player'.'Coins' = 'Coins'+%{coins.%arg-2%}% WHERE '{@table_prefix}Player'.'Player' = '%arg-2%'"
- send "&2&l[&a&lCoins&2&l] &eVous avez set %arg-3% à %arg-2% : Il a maintenant %{coins.%arg-2%}%"
- else:
- send "&2&l[&a&lCoins&2&l] &cVous n'avez pas la permission" to player
- every {@refresh} seconds:
- loop all players:
- update "UPDATE '{@table_prefix}Player' SET '{@table_prefix}Player'.'Coins' = 'Deaths'+%{deaths-%loop-player%}% WHERE '{@table_prefix}Player'.'Player' = '%loop-player%'"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement