• 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!

[TFS 1.x] Enhanced "!kills" that shows amount of frags for red and black skulls

Homeslice

-anoyn/Rage the Mage
Joined
May 9, 2010
Messages
112
Solutions
2
Reaction score
65
Location
Canada
The !kills command only shows your frags, like this:
16:00 You do not have any unjustified kill.

With my changes:
19:56 You do not have any unjustified kills. Red skull at 6 frags. Black skull at 12 frags.

This is just a simple change so players know how many frags are required for red and black skulls. Probably should be in vanilla TFS

Tested with TFS 1.2 and 1.3.

In data\talkactions\scripts\kills.lua
Change:
Lua:
    if fragTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kill.")
        return false
    end
to
Lua:
    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
Change
Lua:
    if skullTime <= 0 then
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, "You do not have any unjustified kill.")
        return false
    end
to
Lua:
    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
Change
Lua:
local message = "You have " .. kills .. " unjustified kill" .. (kills > 1 and "s" or "") .. ". The amount of unjustified kills will decrease after: "
to
Lua:
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: "
 
The !kills command only shows your frags, like this:
16:00 You do not have any unjustified kill.

With my changes:
19:56 You do not have any unjustified kills. Red skull at 6 frags. Black skull at 12 frags.

This is just a simple change so players know how many frags are required for red and black skulls. Probably should be in vanilla TFS

[/code]

I have done these my red skull is 3 but when i do !frags it says 3306...
 
The command is !kills not !frags

If you don't have an existing kills.lua file you probably don't have TFS 1.x which this is for.
 
The command is !kills not !frags

If you don't have an existing kills.lua file you probably don't have TFS 1.x which this is for.

do you have the kills.lua to link here?

i have these one here

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

and i can use !kills or !frags or anyother thing i want i just have to change in talkactions.xml
 
Yours looks the same as mine. What TFS are you using?

TFS 1.3....i think i know my problem....when you kill a player....the skulls time is not being registred in the skulltime...it only registred skull time when you get red skull until that is not being registred there...is registred in someother place that idk
 
Back
Top