Skip to content

Latest commit

 

History

History
60 lines (49 loc) · 1.73 KB

README.md

File metadata and controls

60 lines (49 loc) · 1.73 KB

cs2TTT

Contributing

TTT is in heavy development and I want you to know that contributions are always welcome. Please follow Microsoft's dependency injection system.

Tip

Microsoft has some good documentation on dependency injection here: Overview, Using Dependency Injection, Dependency Injection Guidelines.

Creating items

Creating new items or modifying existing ones is easy. Create a new class in the correct directory, mod/TTT.Shop/Items/{group}. Then create it to your liking. Afterwards, compile the plugin and it's all set. The plugin handles loading all the items.

Tip

Available groups are [All, Detective, Traitor].
SimpleName is used for /buy {name}

Example Item

namespace TTT.Shop.Items.Traitor;

public class AwpItem : IShopItem
{
    public string Name()
    {
        return "AWP";
    }

    public string SimpleName()
    {
        return "awp";
    }

    public int Price()
    {
        return 2000;
    }

    public BuyResult OnBuy(GamePlayer player)
    {
        if (player.Credits() < Price()) return BuyResult.NotEnoughCredits;
        if (player.PlayerRole() != Role.Traitor) return BuyResult.IncorrectRole;
        player.RemoveCredits(Price());
        player.Player().GiveNamedItem(CsItem.AWP);
        return BuyResult.Successful;
    }
}

Road Map

  • [✅] Role assignment
  • [✅] DNA Scanner
  • [✅] Tazer
  • Configuration
  • Karma system
  • Shop
  • RDM Manager
  • Add database support for logs and stats