Adding date specific reward
This guide will show you how to make a reward only enabled on a specific date
You need to utilize the DateSpecific table for your reward. Here is an example:
--[[
HUGE MONEY REWARD ON THE 24TH
--]]
local big_money_min = 5000 -- The minimum amount of money they can get from a present.
local big_money_max = 10000 -- The maximum amount of money they can get from a present.
CH_Advent.Rewards[ 50 ] = { -- MAKE SURE THIS MATCH WITH UniqueID AND YOUR LAST REWARD NUMBER
Name = "CHRISTMAS EVE REWARD",
Enabled = true,
Entries = 30,
UniqueID = 50,
DateSpecific = {
["24"] = true,
},
RewardFunction = function( ply )
local randommoney = math.random( big_money_min, big_money_max )
ply:addMoney( randommoney )
CH_Advent.Notify( ply, CH_Advent.LangString( "You've won" ) .." ".. DarkRP.formatMoney( randommoney ) )
end,
}
The noticeable part is the DateSpecific table, where you determine the dates this reward is available on.
DateSpecific = {
["24"] = true,
},
You can also enable it on multiple days by adding them to the table. Here's an example:
DateSpecific = {
["06"] = true,
["12"] = true,
["18"] = true,
["24"] = true,
},
That would make it enabled on those 4 dates.
THE DATE MUST BE SPECIFIED AS 01 - 24