Staff Pick: DenizenEconomy
By
NoiknezCreated: 2016/09/29 15:05:02 UTC-07:00 (8 years and 85 days ago)
Edited: 2016/09/30 07:04:45 UTC-07:00 (8 years and 84 days ago)
Likes: 0
Staff pick as of: 2016/12/07 23:36:18 UTC-08:00 (8 years and 15 days ago)
Denizen Version: Version 1.0.0
Script Version: Script Version 1.0
Description:
This script is a replacement for essentials-eco.
The flag [dollar] can be replace to whatever you want, so you can use this flag in other scripts
Reminder for flag at the bottom
Thank for Vellric for the help
Commands:
/eco set player amount //// For op : set money to someone
/eco give player amount //// For op : give money to someone
/eco take player amount //// For op : take money from someone
/money (or) /money player //// Show money
/pay player amount //// Pay someone
Download script |
View raw scriptDeconomy:
type: command
name: eco
debug: false
usage: /eco set;take;give player
description: eco command
allowed help:
- determine <player.is_op>
script:
- if !<player.is_op> {
- queue clear
}
- choose <context.args.get[1]||null>:
- case null:
- narrate "<&2>Commandes :"
- narrate "<&7>/eco set player amount"
- narrate "<&7>/eco take player amount"
- narrate "<&7>/eco give player amount"
- narrate "<&7>/money player"
- narrate "<&7>/pay player amount"
#####################
# #
# /eco set player x #
# #
#####################
- case set:
- define joueur <server.match_offline_player[<c.args.get[2]||null>]||false>
- if <context.args.get[2]||null> == null {
- narrate "<&c>You must indicate a player."
- queue clear
}
- if <def[joueur].is[==].to[false]> {
- narrate "<&e><context.args.get[2]> <&c>is not a valid player."
- queue clear
}
- if <context.args.get[3]||null> == null {
- narrate "<&c>You must indicate a number."
- queue clear
}
- if <context.args.get[3]||null> !matches number {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- if <context.args.get[3]> != <context.args.get[3].round_down> {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- flag <def[joueur]> dollar:<context.args.get[3]>
- narrate "<&c>The <&e><def[joueur].name> <&c>money as been fixed to <&e><context.args.get[3]> <&c>dollar."
- queue clear
######################
# #
# /eco take player x #
# #
######################
- case take:
- define joueur <server.match_offline_player[<c.args.get[2]||null>]||false>
- if <context.args.get[2]||null> == null {
- narrate "<&c>You must indicate a player"
- queue clear
}
- if <def[joueur].is[==].to[false]> {
- narrate "<&e><context.args.get[2]> <&c>is not a valid player."
- queue clear
}
- if <context.args.get[3]||null> == null {
- narrate "<&c>You must indicate a number."
- queue clear
}
- if !<player.flag[dollar].sub[<c.args.get[3]>].is[OR_MORE].than[0]> {
- narrate "<&c>The player has not enough dollars <&8>(<&e><player.flag[dollar].round> <&c>dollar<&8>)"
- queue clear
}
- if <context.args.get[3]> !matches number {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- if <context.args.get[3]> != <context.args.get[3].round_down> {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- flag <def[joueur]> dollar:-:<c.args.get[3]>
- narrate "<&e><context.args.get[3]> <&c>dollar has been withdraw of <&e><def[joueur].name><&c>. Amount of the player : <&e><def[joueur].flag[dollar].round||null> <&c>dollar."
######################
# #
# /eco give player x #
# #
######################
- case give:
- define joueur <server.match_offline_player[<c.args.get[2]||null>]||false>
- if <context.args.get[2]||null> == null {
- narrate "<&c>You must indicate a player"
- queue clear
}
- if <def[joueur].is[==].to[false]> {
- narrate "<&e><context.args.get[2]> <&c>is not a valid player."
- queue clear
}
- if <context.args.get[3]||null> == null {
- narrate "<&c>You must indicate a player."
- queue clear
}
- if <context.args.get[3]> !matches number {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- if <context.args.get[3]> != <context.args.get[3].round_down> {
- narrate "<&e><context.args.get[3]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- flag <def[joueur]> dollar:+:<c.args.get[3]>
- narrate "<&e><context.args.get[3]> <&c>dollar has been given to <&e><def[joueur].name><&c>. Amount of the player : <&e><def[joueur].flag[dollar].round||null> <&c>dollar."
- queue clear
#################################
# #
# ~ Financial Transactions ~ #
# #
################################
Pay:
type: command
name: pay
debug: false
usage: /pay
description: Pay someone
allowed help:
- determine <player.is_op>
script:
- define joueur <server.match_player[<c.args.get[1]||null>]||false>
- if <context.args.get[1]||null> == null {
- narrate format:dollarformat "<&c>You must indicate a player. Usage : /pay player amount."
- queue clear
}
- if <def[joueur].is[==].to[false]> {
- narrate format:dollarformat "<&e><context.args.get[1]> <&c>is not valid/online."
- queue clear
}
- if <player> == <def[joueur]> {
- narrate format:dollarformat "<&c>You can't pay yourself."
- queue clear
}
- if <context.args.get[2]||null> == null {
- narrate format:dollarformat "<&c>You must indicate a number"
- queue clear
}
- if <context.args.get[2]> !matches number {
- narrate format:dollarformat "<&e><context.args.get[2]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- if <context.args.get[2]> != <context.args.get[2].round_down> {
- narrate format:dollarformat "<&e><context.args.get[2]> <&c>is not a valid figure, you must indicate numbers."
- queue clear
}
- if !<player.flag[dollar].sub[<c.args.get[2]>].is[OR_MORE].than[0]> {
- narrate format:dollarformat "<&c>You have not enough dollar <&8>(<&e><player.flag[dollar]> <&c>dollar<&8>)<&c>."
- queue clear
}
- if <context.args.get[2]> == 0 {
- narrate format:dollarformat "<&c>The minimum amount for transaction is 1 dollar."
- queue clear
}
- ^flag <player> dollar:-:<context.args.get[2]>
- ^flag <def[joueur]> dollar:+:<context.args.get[2]>
- narrate format:dollarformat "<&2>Financial transaction done !"
- wait 1s
- narrate format:dollarformat "<&7>You have pay <&e><context.args.get[2]> <&7>money to <def[joueur].name>."
- narrate format:dollarformat "<&e><def[joueur].name> <&7>had pay <&e><context.args.get[2]> <&7>money to your account." targets:<def[joueur]>
- wait 1s
- narrate format:dollarformat "<&7>You have now <&e><player.flag[dollar].round> <&7>money." targets:<def[joueur]>
- queue clear
##########
# #
# /money #
# #
##########
Money:
type: command
name: money
debug: false
usage: /money
description: Show your money or someone money
allowed help:
- determine <player.is_op>
script:
- if <c.args.get[1].trim.length||0> == 0 {
- narrate "<&7>You have <player.flag[dollar].round> dollars."
- queue clear
}
- define joueur <server.match_offline_player[<c.args.get[1]>]||false>
- if <def[joueur].is[==].to[false]> {
- narrate "<&e><context.args.get[1]> <&c>is not a valid player."
- queue clear
}
- narrate "<&7><def[joueur].name> had <def[joueur].flag[dollar].round||null> dollar."
- queue clear
dollarformat:
type: format
format: <&8>[<&6>Dollar_Transfert<&8>] <text>
Deconomy_Tracker:
type: world
debug: false
events:
on system time hourly:
- webget "http://stats.denizenscript.com/tracker?script=115&version=1.0"
# Set a value
# - flag player <nameflag>:<valeur>
# Up a flag by '1'
# - flag player <nameflag>:++
# Addition ex '1' (exemple: 1+1)
# - flag player <nameflag>:+:<valeur>
# (Or Soustraction -)
# Add a element
# - flag player <nameflag>:->:<valeur>
# Witdrawh a element
# - flag player <nameflag>:<-:<valeur>
View History