Jump to content

Token "Ends" time displaying N/A after token claimed

Closed 1.1.9

Nomad3211
Nomad3211

Posted

Hi there! 
I just downloaded this and started setting it up. 
Everything seems to function correctly, however, in the /tokenmenu - the "Ends: N/A"  Timer doesnt update for me.

I have the config set with dd-MM-yyyy
and 
"t1": {
      "name": "T1",
      "time_type": "day",
      "time_to_add": 30,
      "vip_group": "vip",

Any help is greatly appreciated! 

  • Curator
imthenewguy

Posted

It returns NA if the player isn't found in data or if vip_levels doesnt contain the specified tier from data.

            if (!pcdData.pentiy.ContainsKey(player.userID)) return "NA";
            var playerData = pcdData.pentiy[player.userID];
            if (!playerData.vip_levels.ContainsKey(tier)) return "NA";
            if (playerData.vip_levels[tier].end_date.Date == DateTime.Now.Date)
            {
                var enddate = playerData.vip_levels[tier].end_date;
                return $"{enddate.Hour}:{enddate.Minute}:{enddate.Second}";
            }

What does your data file look like? Is t1 in there?

  • Like 1
Nomad3211

Posted

Heres the Data file for reference:


  "pentiy": {
    "76561198337084719": {
      "Redemptions": {},
      "vip_levels": {
        "tier1": {
          "start_time": "2025-02-24T00:31:00.004751+00:00",
          "end_date": "2025-03-26T00:31:00.004752+00:00",
          "token_key": "t1"
        }
      }
    }
  }
}

And here is the token in the config:

  "Date time format (case sensitive): dd == day. MM == month. yyyy == year": "dd-MM-yyyy",
  "Prevent players from consuming a token if they are already in the group?": true,
  "How often should the plugin check to see if a player has run out of VIP [seconds]?": 3600.0,
  "Should VIPTokens handle stacking of VIP token items? [set to false if using a stacks plugin]": true,
  "Add your vip tiers and commands here. Use {id} in place of a players userid and {name} in place of their name.": {
    "t1": {
      "name": "Tier 1",
      "time_type": "day",
      "time_to_add": 30,
      "vip_group": "tier1",
      "vip_description": "This is an example of a group only VIP token",
      "remove_tokens_on_wipe": false,
      "token_item": {
        "name": "Tier 1 Token",
        "skin": 2529344523,
        "item_shortname": "radiationresisttea.pure"
      },
      "_command": null,
      "_commands": null,
      "remove_commands": null
    },

  • Curator
imthenewguy

Posted

"t1" in config should be "tier1"

 

  • Love 1
  • Curator
imthenewguy

Posted

Changed Status from Pending to Closed

1.9m

Downloads

Total number of downloads.

9k

Customers

Total customers served.

131.8k

Files Sold

Total number of files sold.

2.8m

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.