Skip to content

discount_config

thomas edited this page Aug 29, 2019 · 5 revisions

Discount config file

This page deals only with the confile file of the discount module.
More general information about the plugin can be found in the discount module wiki page.

Key Tree

"Discount"                                // Root name of the Keyvalue tree - no influence, not used
{
	"Discount Name"                       // Name your discount - will be used on announcement
	{
		"time" "* * * * *"                // The time determines when the discount should be active
		"type" "all"                      // The certain item type to be reduced
		"item" "all"                      // The certain item to be reduced
		"discount" "10%"                  // The discount the price will be reduced
		"player" "3"                      // Minimal players on server before discount start
		"nomsg" "1"                       // Should the start, end and activity of the discount announced?
		"noplans" "1"                     // When a item has a plan should the plans be reduced too?
		"flags" "t"                       // Only player with this flag recieve the discount, no flag = everyone
		"Exclude"                         // All items in "Exclude" will NOT be discounted
		{
			"type" "playermodel"          // All items from a specific type will NOT be reduced
			"item" "uid_uncle_sam_hat"    // This specific item will NOT be reduced
		}
	}
}

Keys and values

"time"

The time determines when the discount should be active.

"time" "* ** ** ** **" - The time determines when the discount should be active.
        ^ ^  ^  ^  ^
        ¦ ¦  ¦  ¦  ¦
        ¦ ¦  ¦  ¦  +----------- Weekday (1-7, Sunday is 7)  only one digit!
        ¦ ¦  ¦  +-------------- Month (01-12)               both two digit!
        ¦ ¦  +----------------- Day (01-31)                 both two digit!
        ¦ +-------------------- Hour (00-23)                both two digit!
        +-----------------------Minute (00-59)              both two digit!
* is a wildcard for the whole period (hour, day, month, year, week)
  • The first part stands for the minutes range of a hour from min 00 to max 59.
  • The second part stands for the hours of a day from min 00 to max 23.
  • The third part stands for the day of a month from min 01 to max 31.
  • The next part stands for the month of a year from min 01 to max 12.
  • The last part stands for the weekday of a week from min 01 to max 7. The week start on monday, so 7 is sunday.

Let us read this example:

"time" "25-55 10-16 20-30 11-12 3"

  • 25-55 - xx.25h until xx.55h
  • 10-16 - 10.xxh until 16.xxh
  • 20-30 - 20th of the month until 30th of the month
  • 11-12 - 11th month till 12th month of the year
  • 3 - 3th day of the week - wednesday

So this discount is every wednesday during the period from 20th till 30th november and december all hours from 10h till 16h during the period from 25min past till 5 till full.

Let us write this example:

"Everyday from may to august from 4pm to 9pm except on sundays"

  • * - All minutes within the hour
  • 16-21 - from 4pm to 9pm
  • 05-08 - from may to august
  • * - Everyday from may to august
  • 1-6 - except on sundays

"time" "* 16-21 05-08 * 1-6"

Examples

"time" "* * * * *" = active at all times
"time" "* 18-18 * * 5-6" = active at friday & saturday at 6.pm
"time" "0 21-22 * * *" = active daily from 9pm till 11pm
"time" "* 14-15 * * 0-4" = active at monday till friday at 2pm till 4pm
"time" "00-04 * * 01-11 *" = active every hour from full to 5min past except on december
"time" "* * 20-30 12-12 *" = only active from 20th-30th december
"time" "* 12-23 * 06-06 *" = only active daily from 12am till 23pm in june


"type" or "item"

"type"

You can discount all items of a specific type. Use the same "type" which is used in items.txt for item types.

You can use "type" "all" to discount all items from all types.

"item"

You can discount one specific item or bundle. Use the "unique_id" which is used in items.txt for items and bundles.

You can use "item" "all" to discount all items. (same as "type" "all")

"type" and "item" can be used together to discount items from a type with a single item from other type.


"discount"

The amount a item will be reduced or increased.

// "discount" "<value>%" - with %, you get a percentage discount
// "discount" "<value>" - without %, this amount will be subtracted (discounted)
// "discount" "-<value>" - add a '-' minus in front of the value to increase the price
  • When using a % after the values this percentage of the original price will be reduced.
  • When using nothing in front or after the values this fixed amount of credits will reduced from price.
  • When using - in front the values this fixed amount of credits will added to the price.
  • When using - in front a % after the values this percentage of the original price will added to the price.
Examples

"discount" "10%" - price will be 10% reduced. E.g. from 1000 credits to 900 credits.
"discount" "33%" - price will be 33% reduced. E.g. from 1000 credits to 666 credits.

"discount" "150" - price will be reduced by 100 credits. E.g. from 1000 credits to 850 credits.
"discount" "500" - price will be reduced by 500 credits. E.g. from 1000 credits to 500 credits.

"discount" "-10%" - price will be 10% increased. E.g. from 1000 credits to 1100 credits.

"discount" "-150" - price will be increased by 150 credits. E.g. from 1000 credits to 1150 credits.


"player"

The minimal amount of players on server before discount become active. Optional attribute - Default value 0.


"nomsg"

Should the start, the end and activity of the discount announced? 0 - no / 1 - yes. Optional attribute - Default value 0.


"noplans"

Should a item with a plan/subscription NOT be reduced? 0 - no / 1 - yes. Optional attribute - Default value 0.


"flags"

Only player with these certain flags will get this discount. No flags will give this discount to all player. Optional attribute - Default value "".


"Exclude"

"type"

The discount exlude all items of this specific type from price reduction. Use the same "type" which is used in items.txt for item types.

"item"

The discount exlude this specific item from price reduction. Use the "unique_id" which is used in items.txt for items and bundles.

"type" and "item" can be used together to exclude discount items from a type and other single items.


Check the confile file for more examples.

Clone this wiki locally