Jump to content

The /hsbuy easy-elite commands not calling in the helicopter

Not a Bug 1.0.17

MNfreakTim
MNfreakTim

Posted

Howdy Zeode,

 

I am sorry if this is something which is caused by a setting in my cfg wrong. But I purchased this plugin earlier and I was attempting to set up a delivery method for the Tiers of attack Helicopters. I have given myself permission to give the signals to players, and was able to give myself one and fight it successfully. I also attempted to use the /hsbuy easy and such commands but these did not call in the Attack heli to my base when I used the command. I also attempted to set this item as a command to be purchased in the Shop UI plugin, but it sent out a null reference exception

 

Failed to call hook 'shop_cmd' on plugin 'Shop v1.1.81' (FormatException: Input string was not in a correct format.) at System.Number.StringToNumber (System.String str, System.Globalization.NumberStyles options, System.Number+NumberBuffer& number, System.Globalization.NumberFormatInfo info, System.Boolean parseDecimal) [0x00057] in :0 at System.Number.ParseInt32 (System.String s, System.Globalization.NumberStyles style, System.Globalization.NumberFormatInfo info) [0x00013] in :0 at System.Int32.Parse (System.String s, System.IFormatProvider provider) [0x00008] in :0 at System.Convert.ToInt32 (System.String value) [0x0000b] in :0 at Oxide.Plugins.Shop.shop_cmd (ConsoleSystem+Arg arg) [0x000b0] in <5a6399876d9f4371a8bb5a24dc40eba6>:0 at Oxide.Plugins.Shop.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x01373] in <5a6399876d9f4371a8bb5a24dc40eba6>:0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <23ba99f131254889867c71f0bd137b1d>:0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <157a94ee66ab4a7991faecd1eb84be3b>:0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <157a94ee66ab4a7991faecd1eb84be3b>:0

 

I am assuming this is largely due to this plugin potentially not being compatible with this plugin. The command I used with the Shop UI plugin is "hsgive medium {steamid} 1"

 

Would you be able to assist me with why when I have the permission given to use the /hsbuy easy or hard command it is not working at the moment for me? Or be able to tell me how to properly set up the chat command so that the ShopUI would also work with the item?

 

Thanks,

 

Tim

ZEODE

Posted

Hi,

 

I think you are confused in how the plugin and commands work. The hsbuy command is not to call the heli, it is for players with permission to buy a Heli Signal, using currency which you set in the config, such as reward points or scrap etc.

If you want to sell the signals in a shop, you should add the item instead of the command. You can add the command if you like, in which case it looks like you are using the incorrect format for the shop system you are using?

But again, add the Heli Signals as items to purchase, using the supply.signal shortname and the custom skin of whatever tier item you are putting in the shop. (all custom skin ID's available on the plugin page,)

MNfreakTim

Posted (edited)

I had assumed when you type /hsbuy easy when given the permission it would use whatever style of currency you have selected. I had intended on using the server reward points which are given using the Economics plugin. I might have had the currency code incorrectly labeled. I left it as RP and then changed it to $ and neither called in the heli or gave me the signal to call in the heli. I Will try to adjust the file using the shortname you mentioned. Should I use eco as the code for economics as I have it set up using economics in other plugins? Or is the $ what you use to identify economics? I will also work to use the shortname to sell the signal directly. This was what I attempted first and it did not work either for me.

 

Update: The Shop UI plugin has all 4 of the Heli Signals in there as well as the normal supply signal. When I use the shortname supply.signal it changes all 4 icons into the elite signal. I think the Shop UI plugin using the shortname as the identifying characteristic for listing the items is causing the problem. I will keep plugging away and hopefully will figure out what setting is not allowing me to give players the ability to buy the signals using the /hsbuy command as I tried to explain before, but apparently did not.

 

Thanks again.

 

Tim

Edited by MNfreakTim
ZEODE

Posted

To start off with, please post your config file as you have it now. This will help me identify any issues with that,

The issue with the shop I'm pretty sure is because you are not setting it up right in the shop config, lots of people use that shop system and can sell custom skinned items including signals just fine. Which shop system are you using? Link?

MNfreakTim

Posted (edited)

Howdy Zeode,

 

Thank you for your time and patience. I am sure the issue I am having is some setting that I have incorrectly set up. Additionally, I am sorry for the haphazardly written message yesterday, my server was having intermittent freezing problems due to a plugin that was causing Null Reference Exceptions like crazy and causing the whole server to freeze up. My brain was a bit fried yesterday as I had 3 exams this week in College as well and I was entirely focused on that up until yesterday.

Attached to the email is the CFG file for the HeliSignal plugin. Also I use the plugin called Shop UI which is available on Code Fling for my in game Shop which is available to players on my server.. The Shop UI plugin uses an Items.json which is located within a Data file to identify which items are available to be sold in the plugin. This is the format I use with that json for the items in question. I have tried this page with both the Heli Signal (Easy) name as well as the supply.signal name as the top line which is used to identify how the item is listed in the Categories list. Each had the same results.

  }, 

"Heli Signal (Easy)": {
    "DisplayName": "Heli Signal (Easy)",
    "Skin": 2920175997,
    "Image": "https://rustynuts.gg/helisignals/easyHeli.png",
    "DefaultAmount": 1,
    "BuyPrice": 1000,
    "SellPrice": 1,
    "Currency": "eco"
  },

Each item is then listed in Categories.json. This json has each item listed by the short.name for each item. This format can be seen below.

      "jackhammer",
      "grenade.smoke",
      "supply.signal",

I tried to place the Heli Signals in the Tool category to match the other supply signal's placement and when I did I used both the supply.signal name for all for items at once, and I used each item with the appropriate Heli Signal (Easy) title in the category.json and the supply.signal name allowed for the item to be purchased properly, but all 4 signals on the page were the same elite Heli Signals. I was able to purchase a signal from each of the icons, but the plugin itself did not differentiate the supply signals based on their skin ID #. When I had the items listed in the json using the Heli Signal (type) name, it would not allow the items to be purchased at all. I would click on the item and it would send the previously mentioned error to the RCON. This is why I believe the plugin utilizes the short.name to pull together the pages listed in the Shop plugin.

 

In the end ideally I would love to have this plugin set up where the player types the /hsbuy (type) command and is given a signal in their inventory which would be called. The reason for this is it would be most similar to how I had previously used the Personal Heli plugin which is available on UMod. That plugin has not been maintained for a while and it was throwing a bunch of Null Reference Exceptions yesterday, which is why I decided to move on from it and purchase your plugin instead. I once again appreciate your time and patience in dealing with me. I know it cannot be easy to have people asking questions all the time, I know how it feels from a server Admin / Owner perspective and it can be a bit taxing at times.

 

Thanks again,

Tim

Edited by MNfreakTim
ZEODE

Posted

Hi, I will answer this fully for you later, I cannot at the minute as I’m with family.

 

you are confusing the config for shop UI. You do not put the heli signal name as the item. The item must be the proper shortname for supply signal.

 

I will put together an example shop config for you later so you know correct format. It is just a error with your config which is causing this.

The hsbuy command already does what you need. But you can also add to shop, both options are available for flexibility. If it’s not working for you, they you either don’t have the perks set up correctly, or you don't have the buy option enabled in the config, or the config is somehow otherwise not correct.

I will check your config later and make sure it’s all good.

 

Speak soon.

 

MNfreakTim

Posted

Howdy Zeode,

 

Please take your time.  My players have been quite patient up to this point and another day or two wait wont bother them too much I am sure. Since you mentioned a "mock shop cfg" I figured I would share with you how I had it set up exactly so that you know what I had on my server. I will list the method which produced the only buyable heli signal in testing for me.

 

Here is the section of the Shop - Categories json

  "Tool": {
    "Image": "https://rustplugins.net/products/shop/hammer-screwdriver.png",
    "Permission": null,
    "Sale": 0.0,
    "Items": [
      "tool.instant_camera",
      "tool.binoculars",
      "explosive.timed",
      "tool.camera",
      "rf.detonator",
      "flare",
      "flashlight.held",
      "geiger.counter",
      "jackhammer",
      "grenade.smoke",
      "supply.signal",
      "supply.signal",
      "supply.signal",
      "supply.signal",
      "supply.signal",
      "surveycharge",
      "cakefiveyear",
      "chainsaw",
      "hammer",
      "hatchet",
      "pickaxe",
      "rock",
      "axe.salvaged",
      "hammer.salvaged",
      "icepick.salvaged",
      "explosive.satchel",
      "stonehatchet",
      "stone.pickaxe",
      "toolgun",
      "torch",
      "bucket.water"
    ]
  },

 

Here is the section of the Shop - Items json

  },
  "supply.signal": {
    "DisplayName": "Supply Signal",
    "Skin": 0,
    "Image": "supply.signal.png",
    "DefaultAmount": 1,
    "BuyPrice": 1000,
    "SellPrice": 1,
    "Currency": "eco"
  },
  "supply.signal": {
    "DisplayName": "Heli Signal (Easy)",
    "Skin": 2920175997,
    "Image": "https://rustynuts.gg/helisignals/easyHeli.png",
    "DefaultAmount": 1,
    "BuyPrice": 1000,
    "SellPrice": 1,
    "Currency": "eco"
  },
    "supply.signal": {
    "DisplayName": "Heli Signal (Medium)",
    "Skin": 2920176079,
    "Image": "https://rustynuts.gg/helisignals/medHeli.png",
    "DefaultAmount": 1,
    "BuyPrice": 1500,
    "SellPrice": 1,
    "Currency": "eco"
  },
    "supply.signal": {
    "DisplayName": "Heli Signal (Hard)",
    "Skin": 2920176050,
    "Image": "https://rustynuts.gg/helisignals/hardHeli.png",
    "DefaultAmount": 1,
    "BuyPrice": 2000,
    "SellPrice": 1,
    "Currency": "eco"
  },
    "supply.signal": {
    "DisplayName": "Heli Signal (Elite)",
    "Skin": 2920176024,
    "Image": "https://rustynuts.gg/helisignals/eliteHeli.png",
    "DefaultAmount": 1,
    "BuyPrice": 3000,
    "SellPrice": 1,
    "Currency": "eco"
  },

 

These json configurations when used together allowed the 5 signals to show up on the shop page. But they all had the picture for the elite heli signal. I purchased one from the all of the 5 signals, which should have in one of each signal type, I ended up with 5 elite signals. I hope this helps you in your troubleshooting. No hurry on the fix, for now as a "temporary fix" I have resorted to only selling the easy heli signal and removing the rest of the signals from the shop so the players have some action. But there are a few who are chomping at the bit to try to the harder versions as this plugin has been requested a number of times for my PvE server.

 

Thanks again,

 

Tim

MNfreakTim

Posted

Howdy Zeode,

 

I changed the currency type to buy the signals  to custom (scrap) and it works. So to me that indicates I am using the wrong code for Server Reward points given by the Economics plugin. Would you be able to confirm the code for Economics? I will just utilize scrap at the for the time being, until I can I identify the  code that coordinates with the Economics plugin I have on my server.

 

Thank you again.

Tim

ZEODE

Posted

OK Tim,

 

So first off, you can call the currency whatever you like, it makes no difference to how the plugin works. It's simply to customise the plugin to suit server owner needs.

Secondly I have looked through your config for the shop and its way off. You can't add the same item with the same name multiple times, you have to tell the Shop plugin what item is which. With Shop UI, you do this by adding a number in cirly brackets after the shortname, like: "supply.signal{1}" "supply.signal{2}" etc.

So for an example, Shop UI items file should contain an entry for each custom supply signal you wish to add, eg:

{
  "supply.signal{1}": {
    "DisplayName": "Normal Patrol Heli",
    "Skin": 2920175997,
    "Image": "https://rustynuts.gg/helisignals/easyHeli.png",
    "DefaultAmount": 1,
    "BlockAmountChange": false,
    "BuyPrice": 500,
    "SellPrice": 0,
    "Currency": "rp",
    "ShowDisplayName": true
  },
  "supply.signal{2}": {
    "DisplayName": "Medium Patrol Heli",
    "Skin": 2920176050,
    "Image": "https://rustynuts.gg/helisignals/hardHeli.png",
    "DefaultAmount": 1,
    "BlockAmountChange": false,
    "BuyPrice": 1000,
    "SellPrice": 0,
    "Currency": "rp",
    "ShowDisplayName": true
  },
  "supply.signal{3}": {
    "DisplayName": "Hard Patrol Heli",
    "Skin": 2920176079,
    "Image": "https://rustynuts.gg/helisignals/medHeli.png",
    "DefaultAmount": 1,
    "BlockAmountChange": false,
    "BuyPrice": 2000,
    "SellPrice": 0,
    "Currency": "rp",
    "ShowDisplayName": true
  },
  "supply.signal{4}": {
    "DisplayName": "Elite Patrol Heli",
    "Skin": 2920176024,
    "Image": "https://rustynuts.gg/helisignals/eliteHeli.png",
    "DefaultAmount": 1,
    "BlockAmountChange": false,
    "BuyPrice": 4000,
    "SellPrice": 0,
    "Currency": "rp",
    "ShowDisplayName": true
  }
}

Then in the categories file, you should have something like this. For example, placing the signals in the Items category/tab, you must have an entry like this, which references the items you just created before:

  "Items": {
    "Image": "https://rustplugins.net/products/shop/box.png",
    "Permission": null,
    "Sale": 0,
    "Items": [
      "supply.signal{1}",
      "supply.signal{2}",
      "supply.signal{3}",
      "supply.signal{4}"
    ]
  },

 

As far as the Heli Signal config goes, it looks fine. You already have the /hsbuy command enabled on all the helis and a price put in. All you need to do is add the buy permission to players to use the buy command.  Players can then do "/hsbuy list" to see a list of options and price. But I would recommend using the shop, as it looks much nicer to see the item there and you have more contol over sales and I think you can add sale cooldown etc too on most shops.

Hopefully that points you in the right direction now. 🙂

ZEODE

Posted

Hey, glad it’s sorted for you 👍🏻

ZEODE

Posted

Changed Status from Pending to Not a Bug

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.