• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

!frags time doesn't change TFS 1.3

nanduzenho

Member
Joined
Mar 21, 2021
Messages
187
Solutions
1
Reaction score
15
GitHub
nanduzenho
Good morning, Does anyone know why the time doesn't change?
FRAGS.JPG

!frags
Lua:
function onSay(player, words, param)
    local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
    if fragTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kills. Red skull at " ..
            configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags. Black skull at " .. configManager.getNumber(configKeys.KILLS_TO_BLACK) .. " frags.")
        return false
    end

    local skullTime = player:getSkullTime()
    if skullTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,  "You do not have any unjustified kills. Red skull at " ..
            configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags. Black skull at " .. configManager.getNumber(configKeys.KILLS_TO_BLACK) .. " frags.")
        return false
    end

    local kills = math.ceil(skullTime / fragTime)
    local remainingSeconds = math.floor((skullTime % fragTime) / 1000)

    local hours = math.floor(remainingSeconds / 3600)
    local minutes = math.floor((remainingSeconds % 3600) / 60)
    local seconds = remainingSeconds % 60

    local message = "You have " .. kills .. " unjustified kill" .. (kills > 1 and "s" or "") .. ". Red skull at " ..
        configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags. Black skull at " .. configManager.getNumber(configKeys.KILLS_TO_BLACK) ..
        " frags. The amount of unjustified kills will decrease after: "
    if hours ~= 0 then
        if hours == 1 then
            message = message .. hours .. " hour, "
        else
            message = message .. hours .. " hours, "
        end
    end

    if hours ~= 0 or minutes ~= 0 then
        if minutes == 1 then
            message = message .. minutes .. " minute and "
        else
            message = message .. minutes .. " minutes and "
        end
    end

    if seconds == 1 then
        message = message .. seconds .. " second."
    else
        message = message .. seconds .. " seconds."
    end

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message)
    return false
end
Post automatically merged:

Solved! I got it!!!

Change this:
Lua:
local remainingSeconds = math.floor((skullTime % fragTime) / 1000)

For this:
Code:
local remainingSeconds = math.floor(skullTime % fragTime)

And this:
Code:
local hours = math.floor(remainingSeconds / 3600)

For this:
Code:
local hours = math.floor(remainingSeconds / 3600000)

XD
 
Last edited:
chang to >
Up, Does anyone have any idea how to fix this? =/
Lua:
function onSay(player, words, param)
    local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
    if fragTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kills. Red skull at " ..
            configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags.")
        return false
    end

    local skullTime = player:getSkullTime()
    if skullTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE,  "You do not have any unjustified kills. Red skull at " ..
            configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags.")
        return false
    end

    local kills = math.ceil(skullTime / fragTime)
    local remainingSeconds = math.floor((skullTime % fragTime) / 1000)

    local hours = math.floor(remainingSeconds / 3600)
    local minutes = math.floor((remainingSeconds % 3600) / 60)
    local seconds = remainingSeconds % 60

    local message = "You have " .. kills .. " unjustified kill" .. (kills > 1 and "s" or "") .. ". Red skull at " ..
        configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags. The amount of unjustified kills will decrease after: "
    if hours ~= 0 then
        if hours == 1 then
            message = message .. hours .. " hour, "
        else
            message = message .. hours .. " hours, "
        end
    end

    if hours ~= 0 or minutes ~= 0 then
        if minutes == 1 then
            message = message .. minutes .. " minute and "
        else
            message = message .. minutes .. " minutes and "
        end
    end

    if seconds == 1 then
        message = message .. seconds .. " second."
    else
        message = message .. seconds .. " seconds."
    end

    player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message)
    return false
end
 
chang to >

function onSay(player, words, param)
local fragTime = configManager.getNumber(configKeys.FRAG_TIME)
if fragTime <= 0 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kills. Red skull at " ..
configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags.")
return false
end

local skullTime = player:getSkullTime()
if skullTime <= 0 then
player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kills. Red skull at " ..
configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags.")
return false
end

local kills = math.ceil(skullTime / fragTime)
local remainingSeconds = math.floor((skullTime % fragTime) / 1000)

local hours = math.floor(remainingSeconds / 3600)
local minutes = math.floor((remainingSeconds % 3600) / 60)
local seconds = remainingSeconds % 60

local message = "You have " .. kills .. " unjustified kill" .. (kills > 1 and "s" or "") .. ". Red skull at " ..
configManager.getNumber(configKeys.KILLS_TO_RED) .. " frags. The amount of unjustified kills will decrease after: "
if hours ~= 0 then
if hours == 1 then
message = message .. hours .. " hour, "
else
message = message .. hours .. " hours, "
end
end

if hours ~= 0 or minutes ~= 0 then
if minutes == 1 then
message = message .. minutes .. " minute and "
else
message = message .. minutes .. " minutes and "
end
end

if seconds == 1 then
message = message .. seconds .. " second."
else
message = message .. seconds .. " seconds."
end

player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, message)
return false
end
Dont work bro

DONT WORK.JPG
 
Paste here where you got the tfs source
 
18:26 You do not have any unjustified kills. Red skull at 3306 frags. Black skull at 3306 frags.

Can help me?
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 10 * 60 * 1000
dayKillsToRedSkull = 12
weekKillsToRedSkull = 15
monthKillsToRedSkull = 17
redSkullDuration = 2
blackSkullDuration = 5
orangeSkullDuration = 7
 
18:26 You do not have any unjustified kills. Red skull at 3306 frags. Black skull at 3306 frags.

Can help me?
timeToDecreaseFrags = 24 * 60 * 60 * 1000
whiteSkullTime = 10 * 60 * 1000
dayKillsToRedSkull = 12
weekKillsToRedSkull = 15
monthKillsToRedSkull = 17
redSkullDuration = 2
blackSkullDuration = 5
orangeSkullDuration = 7
What do you want, I don't understand, explain what you mean
 
Back
Top