Pricing β
Pricing is a shared module to normalize and manipulate prices in your scripts. It supports money, gold, roleplay money (rol) and item prices.
The module uses two table objects:
Price: one payment expression. Multiple entries inside aPriceare paid together.Prices: a list ofPriceoptions, withoperator = "or"for alternatives oroperator = "and"for a single merged option.
TIP
OR is never implicit. Only a root operator = "or" creates payment alternatives. Every other price shape is treated as an AND price.
TIP
You can use the Price Generator to build price tables and paste the generated Lua code into your config files.
Include Pricing in your script β
- To use the Pricing library, just add the initiator as a shared script inside of your
fxmanifest.luafile.
lua
shared_scripts {
'@jo_libs/init.lua'
}- Add the Pricing module inside the
fxmanifest.lua(in lowercase)
lua
jo_libs {
'pricing',
}You can now use the library inside of your resource with the jo.pricing global variable.
Functions β
Documentation for the Both side.