nfell2009

MyConomy V1.0 by nfell2009

Apr 13th, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 13.88 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.  
  18. on skript start:
  19.     set {myc.running.txt} to "True"
  20.     set {myc.running} to true
  21.  
  22. on skript stop:
  23.     set {myc.running.txt} to "False"
  24.     set {myc.running} to false
  25.    
  26. on join:
  27.     if {myc.%player%.started} is not set:
  28.         set {myc.%player%.started} to "True"
  29.         set {myc.%player%.money} to {myc.startingbal}
  30.         set {myc.%player%.lastpayfrom} to "Server"
  31.         set {myc.%player%.lastpayin} to {myc.startingbal}
  32.         message "{@P} You're balance has now been set to: %{myc.%player%.money}%%{myc.currency.plural}%"
  33.         set {_time} to now
  34.         subtract 1 day from {_time}
  35.         add 1 day to {_time}
  36.         log "{@UP} Created this file! %{_time}%" to "myc/%player%"
  37.         log "{@UP} Payment to: '%player%' from 'Server' with amount '%{myc.startingbal}%'" to "MyC/%player%"
  38.  
  39. command /myconomy [<text>] [<text>]:
  40.     description: Main MyConomy command
  41.     permission: {myc.player.perm}
  42.     aliases: /myc, /mycon,
  43.     trigger:
  44.         if arg 1 is not set:
  45.             message "{@P} Unknown command! Do /myc help - for help!"
  46.         else if arg 1 is "help":
  47.             if arg 2 is not set:
  48.                 make player execute command "/mycbypass help 1"
  49.             else if arg 2 is "1":
  50.                 make player execute command "/mycbypass help 1"
  51.             else:
  52.                 message "{@P} Unknown page number!"
  53.         else if arg 1 is "info":
  54.             player has permission "%{myc.admin.perm}%":
  55.                 if arg 2 is not set:
  56.                     message "{@P} You must enter a playername!"
  57.                 else:
  58.                     set {_player} to arg 2 parsed as offline player
  59.                     message "{@P} Showing details for: %{_player}%"
  60.                     if {myc.%{_player}%.money} is greater than 1:
  61.                         message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency.plural}%"
  62.                     else:
  63.                         message "{@P} Money: %{myc.%{_player}%.money}%%{myc.currency}%"
  64.                     if {myc.%{_player}%.lastpayout} is greater than 1:
  65.                         message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency.plural}%"
  66.                     else:
  67.                         message "{@P} L. Payment Out: %{myc.%{_player}%.lastpayout}%%{myc.currency}%"
  68.                     message "{@P} L. Payment To: %{myc.%{_player}%.lastpayto}%"
  69.                     if {myc.%{_player}%.lastpayin} is greater than 1:
  70.                         message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency.plural}%"
  71.                     else:
  72.                         message "{@P} L. Payment In: %{myc.%{_player}%.lastpayin}%%{myc.currency}%"
  73.                     message "{@P} L. Payment From: %{myc.%{_player}%.lastpayfrom}%"
  74.             else:
  75.                 message "{@P} You don't have permission to do that! (Required Node: %{myc.admin.perm}%)"
  76.                    
  77. command /pay [<text>] [<text>]:
  78.     description: Pay another player money
  79.     permission: {myc.player.perm}
  80.     trigger:
  81.         set {_player} to arg 1 parsed as player
  82.         set {_amount} to arg 2 parsed as number
  83.         if arg 1 is not set:
  84.             message "{@P} You must enter a player's name!"
  85.         else if arg 2 is not set:
  86.             message "{@P} You must enter an amount to pay!"
  87.         else if {_amount} is number:
  88.             if {_player} is online:
  89.                 set {_player} to arg 1 parsed as offline player
  90.             else:
  91.                 set {_player} to arg 1 parsed as player
  92.             if {myc.%{_player}%.started} is "True":
  93.                 if {myc.%player%.money} is greater than or equal to {_amount}:
  94.                     subtract {_amount} from {myc.%player%.balance}
  95.                     add arg 2 to {myc.%{_player}%.balance}
  96.                     set {myc.%{_player}%.lastpayin} to arg 2
  97.                     set {myc.%{_player}%.lastpayfrom} to player
  98.                     set {myc.%player%.lastpayout} to {_amount}
  99.                     set {myc.%player%.lastpayto} to {_player}
  100.                     if {_amount} is greater than 1:
  101.                         message "{@P} You paided: %arg 2%%{myc.currency.plural}% to %{_player}%"
  102.                         log "{@UP} %player% paided %arg 2%%{myc.currency.plural}% to %{_player}%" to "myc/%player%"
  103.                         log "{@UP} %{_player}% received %arg 2%%{myc.currency.plural}% from %player%" to "myc/%{_player}%"
  104.                     else:
  105.                         message "{@P} You paided: %arg 2%%{myc.currency}% to %{_player}%"
  106.                         log "{@UP} %player% paided %arg 2%%{myc.currency}% to %{_player}%" to "myc/%player%"
  107.                         log "{@UP} %{_player}% received %arg 2%%{myc.currency}% from %player%" to "myc/%player%"
  108.                    
  109.                 else:
  110.                     set {_amt} to {_amount}
  111.                     subtract {myc.%player%.money} from {_amt}
  112.                     if {_amt} is greater than 1:
  113.                         message "{@P} Your funds don't support the payment! You need: %{_amt}%%{myc.currency.plural}% more!"
  114.                     else:
  115.                         message "{@P} Your funds don't support the payment! You need: %{_amt}%%{myc.currency}% more!"
  116.             else:
  117.                 message "{@P} Couldn't find player: %arg 1%"
  118.         else:
  119.             message "{@P} You can only pay using numbers!"
  120.            
  121. command /balance:
  122.     description: Show's the player's balance
  123.     permission: {myc.player.perm}
  124.     trigger:
  125.         message "{@P} Your balance: %{myc.%player%.money}%"
  126.            
  127. command /myc-admin [<text>] [<text>] [<text>] [<text>]:
  128.     description: Main admin command
  129.     permission: {myc.admin.perm}
  130.     trigger:
  131.         if arg 1 is not set:
  132.             message "{@P} You must give a sub-command! Do /myc-admin help - for help!"
  133.         else if arg 1 is "status":
  134.             player has permission "%{myc.admin.perm}%":
  135.                 message "{@P} MyConomy Status"
  136.                 message "{@P} Running: %{myc.running.txt}%"
  137.                 message "{@P} Currency: %{myc.currency}%"
  138.                 message "{@P} Currency Plural: %{myc.currency.plural}%"
  139.                 message "{@P} Admin Perm: %{myc.admin.perm}%"
  140.                 message "{@P} Player Perm: %{myc.player.perm}%"
  141.         else if arg 1 is "help":
  142.             set {myc.maxahelp} to 3
  143.             make player execute command "/mycbypass adminhelp %arg 2%"
  144.         else if arg 1 is "set":
  145.             set {_amount} to arg 3 parsed as number
  146.             set {_player} to arg 2 parsed as player
  147.             if arg 2 is not set:
  148.                 message "{@P} You must give a player name!"
  149.             else if arg 3 is not set:
  150.                 message "{@P} You must give the value to set the players balance to!"
  151.             else:
  152.                 if {_player} is online:
  153.                     set {_player} to arg 2 parsed as player
  154.                     if {_amount} is greater than 1:
  155.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency.plural}% by %player%" to "myc/%{_player}%"
  156.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency.plural}%"
  157.                         send "{@P} Your balance has been set to: %arg 3%%{myc.currency.plural}% by %player%" to {_player}
  158.                     else:
  159.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency}% by %player%" to "myc/%{_player}%"
  160.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency}%"
  161.                         send "{@P} Your balance has been set to: %arg 3%%{myc.currency}% by %player%" to {_player}
  162.                 else:
  163.                     set {_player} to arg 2 parsed as offline player
  164.                     if {_amount} is greater than 1:
  165.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency.plural}% by %player%" to "myc/%{_player}%"
  166.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency.plural}%"
  167.                     else:
  168.                         log "{@UP} %{_player}%'s money got set to: %arg 3%%{myc.currency}% by %player%" to "myc/%{_player}%"
  169.                         message "{@P} You set: %{_player}%'s money to: %arg 3%%{myc.currency}%"
  170.                 set {myc.%{_player}%.money} to {_amount}
  171.         else if arg 1 is "add":
  172.             set {_amount} to arg 3 parsed as number
  173.             set {_player} to arg 2 parsed as player
  174.             if arg 2 is not set:
  175.                 message "{@P} You must give a player name!"
  176.             else if arg 3 is not set:
  177.                 message "{@P} You must give the value to add to the players balance!"
  178.             else:
  179.                 if {_player} is online:
  180.                     set {_player} to arg 2 parsed as player
  181.                     if {_amount} is greater than 1:
  182.                         log "{@UP} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  183.                         message "{@P} You added: %arg 3%%{myc.currency.plural}% to %{_player}%'s money"
  184.                         send "{@P} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to {_player}
  185.                         set {myc.%{_player}%.lastpayin} to {_amount}
  186.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  187.                     else:
  188.                         log "{@UP} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  189.                         message "{@P} You added: %arg 3%%{myc.currency}% to %{_player}%'s money"
  190.                         send "{@P} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to {_player}
  191.                         set {myc.%{_player}%.lastpayin} to {_amount}
  192.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  193.                 else:
  194.                     set {_player} to arg 2 parsed as offline player
  195.                     if {_amount} is greater than 1:
  196.                         log "{@UP} %arg 3%%{myc.currency.plural}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  197.                         message "{@P} You added: %arg 3%%{myc.currency.plural}% to %{_player}%'s money"
  198.                         set {myc.%{_player}%.lastpayin} to {_amount}
  199.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  200.                     else:
  201.                         log "{@UP} %arg 3%%{myc.currency}% got added to %{_player}%'s balance by %player%" to "myc/%{_player}%"
  202.                         message "{@P} You added: %arg 3%%{myc.currency}% to %{_player}%'s money"
  203.                         set {myc.%{_player}%.lastpayin} to {_amount}
  204.                         set {myc.%{_player}%.lastpayfrom} to "%player% - Money Added"
  205.                 add {_amount} to {myc.%{_player}%.money}
  206.         else if arg 1 is "subtract":
  207.             set {_amount} to arg 3 parsed as number
  208.             set {_player} to arg 2 parsed as player
  209.             if arg 2 is not set:
  210.                 message "{@P} You must give a player name!"
  211.             else if arg 3 is not set:
  212.                 message "{@P} You must give the value to subtract from the players balance!"
  213.             else:
  214.                 if {_player} is online:
  215.                     set {_player} to arg 2 parsed as player
  216.                     if {_amount} is greater than 1:
  217.                         log "{@UP} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  218.                         message "{@P} You subtracted: %arg 3%%{myc.currency.plural}% from %{_player}%'s money"
  219.                         send "{@P} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to {_player}
  220.                     else:
  221.                         log "{@UP} %arg 3%%{myc.currency}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  222.                         message "{@P} You subtracted: %arg 3%%{myc.currency}% from %{_player}%'s money"
  223.                         send "{@P} %arg 3%%{myc.currency}% got subtract from %{_player}%'s balance by %player%" to {_player}
  224.                 else:
  225.                     set {_player} to arg 2 parsed as offline player
  226.                     if {_amount} is greater than 1:
  227.                         log "{@UP} %arg 3%%{myc.currency.plural}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  228.                         message "{@P} You subtracted: %arg 3%%{myc.currency.plural}% from %{_player}%'s money"
  229.                     else:
  230.                         log "{@UP} %arg 3%%{myc.currency}% got subtracted from %{_player}%'s balance by %player%" to "myc/%{_player}%"
  231.                         message "{@P} You subtracted: %arg 3%%{myc.currency}% from %{_player}%'s money"
  232.                 subtract {_amount} from {myc.%{_player}%.money}
  233.         else if arg 1 is "currency":
  234.             if arg 2 is not set:
  235.                 message "{@P} You must give a currency type to change!"
  236.             else if arg 3 is not set:
  237.                 message "{@P} You must give a value to set the currency type!"
  238.             else if arg 2 is "s":
  239.                 set {myc.currency} to arg 3
  240.                 message "{@P} Single currency is now set to: %{myc.currency}%"
  241.             else if arg 2 is "p":
  242.                 set {myc.currency.plural} to arg 3
  243.                 message "{@P} Plural currency is now set to: %{myc.currency.plural}%"
  244.         else if arg 1 is "perm":
  245.             if arg 2 is not set:
  246.                 message "{@P} Will you be showing or setting the permissions?"
  247.             else if arg 3 is not set:
  248.                 message "{@P} You need to enter admin or player to set/show!"
  249.             else if arg 2 is "show":
  250.                 if arg 3 is "admin":
  251.                     message "{@P} Admin permission: %{myc.admin.perm}%"
  252.                 else if arg 3 is "player":
  253.                     message "{@P} Player permission: %{myc.player.perm}%"
  254.                 else:
  255.                     message "{@P} I couldn't find that permission group..."
  256.             else if arg 2 is "set":
  257.                 if arg 3 is "admin":
  258.                     log "{@UP} %player% changed the admin permission from: %{myc.admin.perm}% to %arg 4%" to "myc/logs"
  259.                     set {myc.admin.perm} to arg 4
  260.                     message "{@P} Admin permission is now: %{myc.admin.perm}%"
  261.                 else if arg 3 is "player":
  262.                     log "{@UP} %player% changed the player permission from: %{myc.player.perm}% to %arg 4%" to "myc/logs"
  263.                     set {myc.player.perm} to arg 4
  264.                     message "{@P} Player permission is now: %{myc.player.perm}%"
  265.                 else:
  266.                     message "{@P} I couldn't find that permission group..."
  267.        
  268.        
  269. command /mycbypass [<text>] [<text>] [<text>] [<text>] [<text>]:
  270.     permission: myc.usage
  271.     trigger:
  272.         if arg 1 is "help":
  273.             message "{@P} ---------- MyConomy Help Menu (%arg 2%/1) ----------"
  274.             message "{@P} /myc help - This menu"
  275.             message "{@P} /myc info [player] - Info on you or a player"
  276.             message "{@P} /myc status - Full MyConomy info"
  277.             message "{@P} /pay <player> - Pay a player"
  278.         else if arg 1 is "adminhelp":
  279.             if arg 2 is "1":
  280.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  281.                 message "{@P} /myc-admin status - Status of MyConomy"
  282.                 message "{@P} /myc-admin set <player> <amount> - Set a player's balance"
  283.                 message "{@P} /myc-admin add <player> <amount> - Add money to a player"
  284.                 message "{@P} /myc-admin subtract <player> <amount> - Remove money from a player"
  285.                 message "{@P} Do /myc-admin help 2 for more"
  286.             else if arg 2 is "2":
  287.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  288.                 message "{@P} /myc-admin currency <s/p> <name> - Set the currency name"
  289.                 message "{@P} Currency Key:"
  290.                 message "{@P} S = Single. Example: MC"
  291.                 message "{@P} P = Plural. Example: MCs"
  292.                 message "{@P} Do /myc-admin help 3 for more"
  293.             else if arg 2 is "3":
  294.                 message "{@P} ---------- MyC Admin Help Menu (%arg 2%/%{myc.maxahelp}%) ----------"
  295.                 message "{@P} /myc-admin perm <show|set> <admin|player> <perm> - Set or show permissions"
  296.                 message "{@P} /myc-admin starting <number> - Set the starting balance"
  297.             else:
  298.                 message "{@P} Unknown help page! There are %{myc.maxahelp}% page's that can be viewed."
  299.         else:
  300.             message "{@P} Unknown command!"
Advertisement
Add Comment
Please, Sign In to add comment