Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using Rocket.API;
- using Rocket.Unturned.Chat;
- using UnityEngine;
- using Rocket.Unturned.Player;
- using fr34kyn01535.Uconomy;
- namespace ZaupFeast
- {
- public class CommandSelfFeast : IRocketCommand
- {
- public string Name
- {
- get { return "box"; }
- }
- public string Help
- {
- get { return "Starts the feast onto the player"; }
- }
- public string Syntax
- {
- get { return ""; }
- }
- public List<string> Aliases
- {
- get { return new List<string> { "box" }; }
- }
- public List<string> Permissions
- {
- get { return new List<string>(); }
- }
- public AllowedCaller AllowedCaller
- {
- get
- {
- return AllowedCaller.Both;
- }
- }
- // Run the command.
- public void Execute(IRocketPlayer caller, string[] command)
- {
- UnturnedPlayer player = (UnturnedPlayer)caller;
- if (command.Length == 0)
- {
- UnturnedChat.Say(player, Feast.Instance.Translate("command_usage"));
- return;
- }
- decimal balance = Uconomy.Instance.Database.GetBalance(caller.Id);
- if (command.Length == 1)
- {
- switch (command[0])
- {
- case ("crate"):
- /** UCONOMY **/
- if (balance < 100)
- {
- UnturnedChat.Say(caller, "You are too poor");
- }
- else
- {
- decimal bal = Uconomy.Instance.Database.IncreaseBalance(caller.Id, (100 * -1));
- /** FEAST **/
- Locs loc = new Locs(((UnturnedPlayer)caller).Position, ((UnturnedPlayer)caller).DisplayName + "'s pos");
- Feast.Instance.nextLocation = loc;
- UnturnedChat.Say(caller, Feast.Instance.Translate("box_info"), Color.cyan);
- UnturnedChat.Say(caller, Feast.Instance.Translate("now_feast_msg", new object[] {
- Feast.Instance.nextLocation.Name
- }), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.yellow));
- Feast.Instance.runFeast();
- }
- break;
- case ("crate2"):
- /** UCONOMY **/
- if (balance < 50)
- {
- UnturnedChat.Say(caller, "You are too poor");
- }
- else
- {
- decimal bal = Uconomy.Instance.Database.IncreaseBalance(caller.Id, (50 * -1));
- /** FEAST **/
- Locs loc = new Locs(((UnturnedPlayer)caller).Position, ((UnturnedPlayer)caller).DisplayName + "'s pos");
- Feast.Instance.nextLocation = loc;
- UnturnedChat.Say(caller, Feast.Instance.Translate("box_info"), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.yellow));
- UnturnedChat.Say(caller, Feast.Instance.Translate("now_feast_msg", new object[] {
- Feast.Instance.nextLocation.Name
- }), UnturnedChat.GetColorFromName(Feast.Instance.Configuration.Instance.MessageColor, Color.green));
- Feast.Instance.runFeast2();
- }
- break;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement