Solved Add Support for Shoppy Stock Currency

I'm a bit confused, are you trying to reward players for being AFK?
haha, yes because there are players that are standing the whole night on the the server for just some extra coins. I know this because we had the playtime rewards from umod from 2021-2022. Why? More players on the servers helps us to get us more new players because of the server list population. Sounds weird yes, but we are planning a redo on our server and thats one thing we want to get back -> to reward players playing or being on server and bind them on our server :)
 
Sorry to bother you again.
I don't think the ShoppyStock worked. Nothing is added to me ingame. I should also be able to set in the config which currency I want to address in the Shoppystock. ShoppyStock supports as many custom currencies as you want and these are declared in the API with ShopName. In addition to name: “stock” (plugin) there should also be an entry currency: “yxz”

I have an example from one of our plugins:

private const string SHOP_NAME = "Irrenticket";
//ConsoleSystem.Run(ConsoleSystem.Option.Server, $"sr add {PlayerId} {RefundAmount}");
var shop = Interface.Oxide.RootPluginManager.GetPlugin("ShoppyStock");
shop?.Call("GiveCurrency", SHOP_NAME, PlayerId, RefundAmount);
var player = BasePlayer.FindByID(PlayerId);
if (player != null)


We have this to refund players after an unsuccessful purchase.
Can you maybe take another look?
 
yes 1.2.0
JSON:
{
  "Version": "1.2.0",
  "Rewards": [
    {
      "Playtime Minutes": 1.0,
      "Include AFK Time": false,
      "Currencies": [
        {
          "Enabled": true,
          "Name": "stock",
          "Amount": 1,
          "Valid": false
        }
      ],
      "Run Random Command": false,
      "Commands": [
        {
          "Type": "Chat",
          "Command": "/kit starter"
        }
      ],
      "Experience XP": 150.0,
      "Global Message (Sent to Everyone)": "{PlayerName} just played for {PlaytimeMinutes} minutes and picked up their first reward!",
      "Personal Message (Sent to Recipient)": "You've reached {PlaytimeFormatted}. 25 Economy and 150 XP have been rewarded. Use /kit starter to claim your gear."
    },
    {
      "Playtime Minutes": 120.0,
      "Include AFK Time": false,
      "Currencies": [
        {
          "Enabled": false,
          "Name": "point",
          "Amount": 100,
          "Valid": false
        },
        {
          "Enabled": false,
          "Name": "scrap",
          "Amount": 300,
          "Valid": false
        }
      ],
      "Run Random Command": false,
      "Commands": [
        {
          "Type": "Server",
          "Command": "spawnmini {PlayerId}"
        },
        {
          "Type": "Client",
          "Command": "note.inv"
        }
      ],
      "Experience XP": 0.0,
      "Global Message (Sent to Everyone)": "{PlayerName} just hit {PlaytimeHours} hours of active play and unlocked a new milestone!",
      "Personal Message (Sent to Recipient)": "You've earned {ExperienceXp} XP and some extra goodies for {PlaytimeFormatted} of time in-game."
    }
  ]
}
 
Last edited by a moderator:
Just pushed a new version. Please reset your config, set the shop name and playtime values, then wait at least 5-10 minutee. Playtime Tracker sends updates during that window, and then let me know how it goes after that
 
Back
Top
Chat commands start with a /, while console commands can be entered directly in the F1 console or server console. Use find <keyword> in console to search for available commands related to the plugin. Parameters in < > are required, while [ ] are optional.
This plugin uses Oxide's permission system. Grant or revoke permissions using oxide.grant and oxide.revoke. You can assign them to individual players or groups using their Steam id or group name.
Settings are stored in the config file found under the config/ directory. You can edit this file manually, then reload the plugin to apply your changes.
Persistent data is saved in the data/ directory. This includes things like saved settings, usage stats, or player progress depending on the plugin. Deleting a data file will reset stored progress or customizations.
Language files are located in the lang/ folder. To translate messages, copy the en.json file into your target language folder (e.g. fr, de) and edit the values. Reload the plugin after changes to apply new messages.
This section lists public methods exposed by the plugin for use in other plugins. You can call these via the CallHook method. Ensure the plugin is loaded before calling its API to avoid null reference errors.
These are custom hooks that other plugins can listen for. Simply define a method with the same name and expected parameters in your plugin to handle the event. Hooks are triggered at key moments and are useful for extending or reacting to plugin behavior.
These hooks are injected into the game's code using Harmony. They let the plugin run code at key points in the game's internal logic. You can return values to block or modify behavior. Use with caution — these are powerful and can affect core mechanics.
Cart