mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-06-15 21:24:28 +02:00
introduce free premium time on first login in very first hours
This commit is contained in:
parent
190044d31e
commit
4d0b37e730
@ -10,6 +10,16 @@ function onLogin(player)
|
|||||||
|
|
||||||
loginStr = string.format("Your last visit on " .. configManager.getString(configKeys.SERVER_NAME) .. ": %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
|
loginStr = string.format("Your last visit on " .. configManager.getString(configKeys.SERVER_NAME) .. ": %s.", os.date("%a %b %d %X %Y", player:getLastLoginSaved()))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local dayNow = tonumber(os.date("%d", os.time()))
|
||||||
|
local hourNow = tonumber(os.date("%H", os.time()))
|
||||||
|
if dayNow == 8 and hourNow <= 20 then
|
||||||
|
if player:getPremiumDays() == 0 then
|
||||||
|
player:addPremiumDays(5)
|
||||||
|
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "Congratulations " .. player:getName() .. " on starting your adventure at the " .. configManager.getString(configKeys.SERVER_NAME) .. "! 5 premium days have been added to your account!")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
|
player:sendTextMessage(MESSAGE_STATUS_DEFAULT, loginStr)
|
||||||
|
|
||||||
-- Stamina
|
-- Stamina
|
||||||
|
Loading…
x
Reference in New Issue
Block a user