nfell2009

MyConomy V1.1 by nfell2009

Apr 15th, 2014
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 18.29 KB | None | 0 0
  1. #MyConomy - V1.0
  2. #By nfell2009
  3.  
  4.  
  5. options:
  6.     P: &6[&eMyC&6]&e
  7.     UP: [MyC]
  8.  
  9. variables:
  10.     {myc.startingbal} = 1500
  11.     {myc.currency} = "MC"
  12.     {myc.currency.plural} = "MCs"
  13.     {myc.enabled} = true
  14.     {myc.enabled.txt} = "True"
  15.     {myc.admin.perm} = "myc.admin"
  16.     {myc.player.perm} = "myc.usage"
  17.     {myc.others.perm} = "myc.others"
  18.     {myc.log.prefix} = "[MyC]"
  19.     {myc.minusfixer} = true
  20.  
  21. on skript start:
  22.     set {myc.running.txt} to "True"
  23.     set {myc.running} to true
  24.  
  25. on skript stop:
  26.     set {myc.running.txt} to "False"
  27.     set {myc.running} to false
  28.    
  29. on join:
  30.     if {myc.%player%.started} is not set:
  31.         set {myc.%player%.started} to "True"
  32.         set {myc.%player%.money} to {myc.startingbal}
  33.         set {myc.%player%.lastpayfrom} to "Server"
  34.         set {myc.%player%.lastpayin} to {myc.startingbal}
  35.         message "{@P} You're balance has now been set to: %{myc.%player%.money}%%{myc.currency.plural}%"
  36.         set {_time} to now
  37.         subtract 1 day from {_time}
  38.         add 1 day to {_time}
  39.         log "{@UP} Created this file! %{_time}%" to "myc/%player%"
  40.         log "{@UP} Payment to: '%player%' from 'Server' with amount '%{myc.startingbal}%'" to "MyC/%player%"
  41.         add {myc.startingbal} to {myc.total.monies}
  42.    
  43. command /myconomy [<text>] [<text>]:
  44.     description: Main MyConomy command
  45.     permission: {myc.player.perm}
  46.     aliases: /myc, /mycon,
  47.     trigger:
  48.         if arg 1 is not set:
  49.             message "{@P} Unknown command! Do /myc help - for help!"
  50.         else if arg 1 is "help":
  51.             if arg 2 is not set:
  52.                 make player execute command "/mycbypass help 1"
  53.             else if arg 2 is "1":
  54.                 make player execute command "/mycbypass help 1"
  55.             else:
  56.                 message "{@P} Unknown page number!"
  57.         else if arg 1 is "info":
  58.             if arg 2 is not set:
  59.                 set {_player} to player
  60.                 message "{@P} Showing details for: %{_player}%"
  61.                 if {myc.%{_player}%.money} is greater than 1:
  62.                     message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency.plural}%"
  63.                 else:
  64.                     message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency}%"
  65.                 if {myc.%{_player}%.lastpayout} is greater than 1:
  66.                     message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency.plural}%"
  67.                 else:
  68.                     message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency}%"
  69.                 message "{@P} L. Payment To: %{myc.%{_player}%.lastpayto}%"
  70.                 if {myc.%{_player}%.lastpayin} is greater than 1:
  71.                     message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency.plural}%"
  72.                 else:
  73.                     message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency}%"
  74.                 message "{@P} L. Payment From: %{myc.%{_player}%.lastpayfrom}%"
  75.             else if player has permission "%{myc.others.perm}%":
  76.                 if {myc.%arg 2%.started} is "True":
  77.                     set {_player} to arg 2 parsed as offline player
  78.                     message "{@P} Showing details for: %{_player}%"
  79.                     if {myc.%{_player}%.money} is greater than 1:
  80.                         message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency.plural}%"
  81.                     else:
  82.                         message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency}%"
  83.                     if {myc.%{_player}%.lastpayout} is greater than 1:
  84.                         message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency.plural}%"
  85.                     else:
  86.                         message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency}%"
  87.                     message "{@P} L. Payment To: %{myc.%{_player}%.lastpayto}%"
  88.                     if {myc.%{_player}%.lastpayin} is greater than 1:
  89.                         message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency.plural}%"
  90.                     else:
  91.                         message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency}%"
  92.                     message "{@P} L. Payment From: %{myc.%{_player}%.lastpayfrom}%"
  93.                 else:
  94.                     message "{@P} Couldn't find player: %arg 2%!"
  95.             else:
  96.                 message "{@P} You don't have permission to do that! (Required Node: %{myc.others.perm}%)"
  97.         else if arg 1 is "total":
  98.             if arg 2 is not set:
  99.                 message "{@P} You must give a total you wish to see!"
  100.             else if arg 2 is "money":
  101.                 if {myc.total.monies} is greater than 1:
  102.                     message "{@P} There is: %{myc.total.monies}%%{myc.currency.plural}% money in the economy."
  103.                 else:
  104.                     message "{@P} There is: %{myc.total.monies}%%{myc.currency}% money in the economy."
  105.             else:
  106.                 message "{@P} More totals are coming soon!"
  107.                    
  108. command /pay [<text>] [<text>]:
  109.     description: Pay another player money
  110.     permission: {myc.player.perm}
  111.     trigger:
  112.         set {_player} to arg 1 parsed as player
  113.         set {_amount} to arg 2 parsed as number
  114.         if arg 1 is not set:
  115.             message "{@P} You must enter a player's name!"
  116.         else if arg 2 is not set:
  117.             message "{@P} You must enter an amount to pay!"
  118.         else if {_amount} is number:
  119.             if {_player} is online:
  120.                 set {_player} to arg 1 parsed as offline player
  121.             else:
  122.                 set {_player} to arg 1 parsed as player
  123.             if {myc.%{_player}%.started} is "True":
  124.                 if {myc.%player%.money} is greater than or equal to {_amount}:
  125.                     subtract {_amount} from {myc.%player%.balance}
  126.                     add arg 2 to {myc.%{_player}%.balance}
  127.                     set {myc.%{_player}%.lastpayin} to arg 2
  128.                     set {myc.%{_player}%.lastpayfrom} to player
  129.                     set {myc.%player%.lastpayout} to {_amount}
  130.                     set {myc.%player%.lastpayto} to {_player}
  131.                     if {_amount} is greater than 1:
  132.                         message "{@P} You paided: %arg 2%%{myc.currency.plural}% to %{_player}%"
  133.                         log "{@UP} %player% paided %arg 2%%{myc.currency.plural}% to %{_player}%" to "myc/%player%"
  134.                         log "{@UP} %{_player}% received %arg 2%%{myc.currency.plural}% from %player%" to "myc/%{_player}%"
  135.                     else:
  136.                         message "{@P} You paided: %arg 2%%{myc.currency}% to %{_player}%"
  137.                         log "{@UP} %player% paided %arg 2%%{myc.currency}% to %{_player}%" to "myc/%player%"
  138.                         log "{@UP} %{_player}% received %arg 2%%{myc.currency}% from %player%" to "myc/%player%"
  139.                    
  140.                 else:
  141.                     set {_amt} to {_amount}
  142.                     subtract {myc.%player%.money} from {_amt}
  143.                     if {_amt} is greater than 1:
  144.                         message "{@P} Your funds don't support the payment! You need: %{_amt}%%{myc.currency.plural}% more!"
  145.                     else:
  146.                         message "{@P} Your funds don't support the payment! You need: %{_amt}%%{myc.currency}% more!"
  147.             else:
  148.                 message "{@P} Couldn't find player: %arg 1%"
  149.         else:
  150.             message "{@P} You can only pay using numbers!"
  151.            
  152. command /balance [<text>]:
  153.     description: Show's the player's balance
  154.     permission: {myc.player.perm}
  155.     aliases: /bal, /balancetop, /money,
  156.     trigger:
  157.         if arg 1 is not set:
  158.             if {myc.%{_player}%.money} is greater than 1:
  159.                 message "{@P} Your balance: %{myc.%player%.money}%%{myc.currency.plural}%"
  160.             else:
  161.                 message "{@P} Your balance: %{myc.%player%.money}%%{myc.currency}%"
  162.         else if player has permission "%{myc.others.perm}%":
  163.             set {_player} to arg 1 parsed as player
  164.             if {_player} is online:
  165.                 if {myc.%{_player}%.started} is "True":
  166.                     if {myc.%{_player}%.money} is greater than 1:
  167.                         message "{@P} %{_player}%'s balance: %{myc.%{_player}%.money}%%{myc.currency.plural}%"
  168.                     else:
  169.                         message "{@P} %{_player}%'s balance: %{myc.%{_player}%.money}%%{myc.currency}%"
  170.                 else:
  171.                     message "{@P} Couldn't find that player!"
  172.             else:
  173.                 set {_player} to arg 1 parsed as offline player
  174.                 if {myc.%{_player}%.started} is "True":
  175.                     if {myc.%{_player}%.money} is greater than 1:
  176.                         message "{@P} %{_player}%'s balance: %{myc.%{_player}%.money}%%{myc.currency.plural}%"
  177.                     else:
  178.                         message "{@P} %{_player}%'s balance: %{myc.%{_player}%.money}%%{myc.currency}%"
  179.                 else:
  180.                     message "{@P} Couldn't find that player!"
  181.                                
  182. command /myc-admin [<text>] [<text>] [<text>] [<text>]:
  183.     description: Main admin command
  184.     permission: {myc.admin.perm}
  185.     trigger:
  186.         if arg 1 is not set:
  187.             message "{@P} You must give a sub-command! Do /myc-admin help - for help!"
  188.         else if arg 1 is "status":
  189.             player has permission "%{myc.admin.perm}%":
  190.                 message "{@P} MyConomy Status"
  191.                 message "{@P} Running: %{myc.running.txt}%"
  192.                 message "{@P} Currency: %{myc.currency}%"
  193.                 message "{@P} Currency Plural: %{myc.currency.plural}%"
  194.                 message "{@P} Admin Perm: %{myc.admin.perm}%"
  195.                 message "{@P} Player Perm: %{myc.player.perm}%"
  196.         else if arg 1 is "help":
  197.             set {myc.maxahelp} to 3
  198.             make player execute command "/mycbypass adminhelp %arg 2%"
  199.         else if arg 1 is "set":
  200.             set {_amount} to arg 3 parsed as number
  201.             set {_player} to arg 2 parsed as player
  202.             if arg 2 is not set:
  203.                 message "{@P} You must give a player name!"
  204.             else if arg 3 is not set:
  205.                 message "{@P} You must give the value to set the players balance to!"
  206.             else:
  207.                 if {_player} is online:
  208.                     set {_player} to arg 2 parsed as player
  209.                     if {_amount} is greater than 1:
  210.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency.plural}% by %player%" to "myc/%{_player}%"
  211.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency.plural}%"
  212.                         send "{@P} Your balance has been set to: %arg 3%%{myc.currency.plural}% by %player%" to {_player}
  213.                     else:
  214.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency}% by %player%" to "myc/%{_player}%"
  215.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency}%"
  216.                         send "{@P} Your balance has been set to: %arg 3%%{myc.currency}% by %player%" to {_player}
  217.                 else:
  218.                     set {_player} to arg 2 parsed as offline player
  219.                     if {_amount} is greater than 1:
  220.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency.plural}% by %player%" to "myc/%{_player}%"
  221.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency.plural}%"
  222.                     else:
  223.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency}% by %player%" to "myc/%{_player}%"
  224.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency}%"
  225.                 set {myc.total.monies} to {myc.total.monies} - {myc.%{_player}%.money}
  226.                 set {myc.%{_player}%.money} to {_amount}
  227.                 add {myc.%{_player}%.money} to {myc.total.monies}
  228.         else if arg 1 is "add":
  229.             set {_amount} to arg 3 parsed as number
  230.             set {_player} to arg 2 parsed as player
  231.             if arg 2 is not set:
  232.                 message "{@P} You must give a player name!"
  233.             else if arg 3 is not set:
  234.                 message "{@P} You must give the value to add to the players balance!"
  235.             else:
  236.                 if {_player} is online:
  237.                     set {_player} to arg 2 parsed as player
  238.                     if {_amount} is greater than 1:
  239.                         log "{@UP} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  240.                         message "{@P} You added: %arg 3%%{myc.currency.plural}% to %{_player}%'s money"
  241.                         send "{@P} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to {_player}
  242.                         set {myc.%{_player}%.lastpayin} to {_amount}
  243.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  244.                     else:
  245.                         log "{@UP} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  246.                         message "{@P} You added: %arg 3%%{myc.currency}% to %{_player}%'s money"
  247.                         send "{@P} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to {_player}
  248.                         set {myc.%{_player}%.lastpayin} to {_amount}
  249.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  250.                 else:
  251.                     set {_player} to arg 2 parsed as offline player
  252.                     if {_amount} is greater than 1:
  253.                         log "{@UP} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  254.                         message "{@P} You added: %arg 3%%{myc.currency.plural}% to %{_player}%'s money"
  255.                         set {myc.%{_player}%.lastpayin} to {_amount}
  256.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  257.                     else:
  258.                         log "{@UP} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  259.                         message "{@P} You added: %arg 3%%{myc.currency}% to %{_player}%'s money"
  260.                         set {myc.%{_player}%.lastpayin} to {_amount}
  261.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  262.                 add {_amount} to {myc.%{_player}%.money}
  263.                 add {_amount} to {myc.total.monies}
  264.         else if arg 1 is "subtract":
  265.             set {_amount} to arg 3 parsed as number
  266.             set {_player} to arg 2 parsed as player
  267.             if arg 2 is not set:
  268.                 message "{@P} You must give a player name!"
  269.             else if arg 3 is not set:
  270.                 message "{@P} You must give the value to subtract from the players balance!"
  271.             else:
  272.                 if {_player} is online:
  273.                     set {_player} to arg 2 parsed as player
  274.                     if {_amount} is greater than 1:
  275.                         log "{@UP} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  276.                         message "{@P} You subtracted: %arg 3%%{myc.currency.plural}% from %{_player}%'s money"
  277.                         send "{@P} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to {_player}
  278.                     else:
  279.                         log "{@UP} %arg 3%%{myc.currency}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  280.                         message "{@P} You subtracted: %arg 3%%{myc.currency}% from %{_player}%'s money"
  281.                         send "{@P} %arg 3%%{myc.currency}% got subtract from %{_player}%'s balance by %player%" to {_player}
  282.                 else:
  283.                     set {_player} to arg 2 parsed as offline player
  284.                     if {_amount} is greater than 1:
  285.                         log "{@UP} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  286.                         message "{@P} You subtracted: %arg 3%%{myc.currency.plural}% from %{_player}%'s money"
  287.                     else:
  288.                         log "{@UP} %arg 3%%{myc.currency}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  289.                         message "{@P} You subtracted: %arg 3%%{myc.currency}% from %{_player}%'s money"
  290.                 subtract {_amount} from {myc.%{_player}%.money}
  291.                 subtract {_amount} from {myc.total.monies}
  292.         else if arg 1 is "currency":
  293.             if arg 2 is not set:
  294.                 message "{@P} You must give a currency type to change!"
  295.             else if arg 3 is not set:
  296.                 message "{@P} You must give a value to set the currency type!"
  297.             else if arg 2 is "s":
  298.                 set {myc.currency} to arg 3
  299.                 message "{@P} Single currency is now set to: %{myc.currency}%"
  300.             else if arg 2 is "p":
  301.                 set {myc.currency.plural} to arg 3
  302.                 message "{@P} Plural currency is now set to: %{myc.currency.plural}%"
  303.         else if arg 1 is "perm":
  304.             if arg 2 is not set:
  305.                 message "{@P} Will you be showing or setting the permissions?"
  306.             else if arg 3 is not set:
  307.                 message "{@P} You need to enter admin or player to set/show!"
  308.             else if arg 2 is "show":
  309.                 if arg 3 is "admin":
  310.                     message "{@P} Admin permission: %{myc.admin.perm}%"
  311.                 else if arg 3 is "player":
  312.                     message "{@P} Player permission: %{myc.player.perm}%"
  313.                 else:
  314.                     message "{@P} I couldn't find that permission group..."
  315.             else if arg 2 is "set":
  316.                 if arg 3 is "admin":
  317.                     log "{@UP} %player% changed the admin permission from: %{myc.admin.perm}% to %arg 4%" to "myc/logs"
  318.                     set {myc.admin.perm} to arg 4
  319.                     message "{@P} Admin permission is now: %{myc.admin.perm}%"
  320.                 else if arg 3 is "player":
  321.                     log "{@UP} %player% changed the player permission from: %{myc.player.perm}% to %arg 4%" to "myc/logs"
  322.                     set {myc.player.perm} to arg 4
  323.                     message "{@P} Player permission is now: %{myc.player.perm}%"
  324.                 else if arg 3 is "others":
  325.                     log "{@UP} %player% changed the other's permission from: %{myc.others.perm}% to %arg 4%" to "myc/logs"
  326.                     set {myc.others.perm} to arg 4
  327.                     message "{@P} Player permission is now: %{myc.others.perm}%"
  328.                 else:
  329.                     message "{@P} I couldn't find that permission group..."
  330.         else if arg 1 is "minusfixer":
  331.             if arg 2 is not set:
  332.                 message "{@P} Do you want to toggle or show the minus fixer status?"
  333.             else if arg 2 is "on":
  334.                 set {myc.minusfixer} to true
  335.                 message "{@P} Turned on minus fixer"
  336.             else if arg 2 is "off":
  337.                 set {myc.minusfixer} to false
  338.                 message "{@P} Turned off minus fixer"
  339.             else if arg 2 is "status":
  340.                 message "{@P} Minus fixer status: %{myc.minusfixer}%"
  341.             else:
  342.                 message "{@P} Unknown Minus Fixer subcommand!"
  343.        
  344.        
  345. command /mycbypass [<text>] [<text>] [<text>] [<text>] [<text>]:
  346.     permission: myc.usage
  347.     trigger:
  348.         if arg 1 is "help":
  349.             message "{@P} ---------- MyConomy Help Menu (%arg 2%/1) ----------"
  350.             message "{@P} /myc help - This menu"
  351.             message "{@P} /myc info [player] - Info on you or a player"
  352.             message "{@P} /pay <player> <amount> - Pay a player"
  353.             message "{@P} /bal [player] - Check your balance or see another players"
  354.         else if arg 1 is "adminhelp":
  355.             if arg 2 is "1":
  356.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  357.                 message "{@P} /myc-admin status - Status of MyConomy"
  358.                 message "{@P} /myc-admin set <player> <amount> - Set a player's balance"
  359.                 message "{@P} /myc-admin add <player> <amount> - Add money to a player"
  360.                 message "{@P} /myc-admin subtract <player> <amount> - Remove money from a player"
  361.                 message "{@P} Do /myc-admin help 2 for more"
  362.             else if arg 2 is "2":
  363.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  364.                 message "{@P} /myc-admin currency <s/p> <name> - Set the currency name"
  365.                 message "{@P} Currency Key:"
  366.                 message "{@P} S = Single. Example: MC"
  367.                 message "{@P} P = Plural. Example: MCs"
  368.                 message "{@P} Do /myc-admin help 3 for more"
  369.             else if arg 2 is "3":
  370.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  371.                 message "{@P} /myc-admin perm <show|set> <admin|player|others> <perm> - Set or show permissions"
  372.                 message "{@P} /myc-admin starting <number> - Set the starting balance"
  373.                 message "{@P} /myc-admin status - Full MyConomy info"
  374.                 message "{@P} /myc-admin minusfixer <on|off|status> - Should accounts with minus be set to 0?"
  375.                 message "{@P} Minus Fixer default = on"
  376.             else:
  377.                 message "{@P} Unknown help page! There are %{myc.maxahelp}% page's that can be viewed."
  378.         else:
  379.             message "{@P} Unknown command!"
  380.            
  381. every 1 second:
  382.     if {myc.minusfixer} is true:
  383.         loop all players:
  384.             if {myc.%loop-player%.money} is less than 0:
  385.                 set {_prevmoney} to {myc.%loop-player%.money}
  386.                 set {myc.%loop-player%.money} to 0
  387.                 log "{@UP} %loop-player%'s money got fixed from: {_prevmoney} to {myc.%loop-player%.money} by Minus Fixer"
  388.                 set {_prevmoney} to ({_prevmoney} - {_prevmoney}) - {_prevmoney}
  389.                 send "{@P} Miuns fixer has reset you balance to: 0" to loop-player
  390.                 set {myc.%loop-player%.lastpayin} to {_prevmoney}
  391.                 set {myc.%loop-player%.lastpayfrom} to "Minus Fixer"
  392.     if {myc.total.monies} is less than 0:
  393.         set {myc.total.monies} to 0
Advertisement
Add Comment
Please, Sign In to add comment