mirror of
https://github.com/ErikasKontenis/SabrehavenServer.git
synced 2025-04-29 17:19:20 +02:00
set maximum 6 hours of offline training
This commit is contained in:
parent
8092feb787
commit
0b92913208
@ -15,7 +15,7 @@ function onLogin(player)
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
||||||
local trainingTime = math.max(0, math.min(offlineTime, math.min(43200, player:getOfflineTrainingTime() / 1000)))
|
local trainingTime = math.max(0, math.min(offlineTime, math.min(43200 / 2, player:getOfflineTrainingTime() / 1000)))
|
||||||
player:removeOfflineTrainingTime(trainingTime * 1000)
|
player:removeOfflineTrainingTime(trainingTime * 1000)
|
||||||
|
|
||||||
local remainder = offlineTime - trainingTime
|
local remainder = offlineTime - trainingTime
|
||||||
|
@ -5,7 +5,7 @@ function Player:onLook(thing, position, distance)
|
|||||||
|
|
||||||
if thing:isItem() and thing:getId() == 2028 then
|
if thing:isItem() and thing:getId() == 2028 then
|
||||||
if isInArray(trainingStatues, thing:getActionId()) then
|
if isInArray(trainingStatues, thing:getActionId()) then
|
||||||
local trainingTime = math.min(43200, self:getOfflineTrainingTime() / 1000)
|
local trainingTime = math.min(43200 / 2, self:getOfflineTrainingTime() / 1000)
|
||||||
local text = "You have"
|
local text = "You have"
|
||||||
local hours = math.floor(trainingTime / 3600)
|
local hours = math.floor(trainingTime / 3600)
|
||||||
if hours > 1 then
|
if hours > 1 then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user