Jump to content

deathmessages


Recommended Posts

Posted
Post the script .

i meant is there any file i can edit on or i just make new script?

Maybe this:

Your MTA folder/server/mods/deathmatch/resources/[gameplay]/deathmessages

but this is only for Play mode not Race..

take a look:

local root = getRootElement() 
  
addEventHandler("onPlayerWasted", root, 
    function (ammo, killer, weapon, bodypart) 
        local r, g, b = getColorFromString(string.upper(get("color"))) 
        local message 
        if killer then 
            if killer ~= source then 
                local killerType = getElementType(killer) 
                if killerType == "player" then 
                    message = getPlayerName(killer).." killed "..getPlayerName(source).."." 
                elseif killerType == "vehicle" then 
                    message = getPlayerName(getVehicleController(killer)).." killed "..getPlayerName(source).."." 
                    if get("show_vehiclename") then 
                        message = message .. " ("..getVehicleName(killer)..")" 
                    end 
                end 
            else 
                message = getPlayerName(source).." committed suicide." 
            end 
        end 
        if not message then 
            message = getPlayerName(source).." died." 
        end 
        if weapon and get("show_weapon") then 
            local weaponName = getWeaponNameFromID(weapon) 
            if weaponName then 
                message = message.." ("..weaponName..")" 
            end 
        end 
        if bodypart and get("show_bodypart") then 
            local bodypartName = getBodyPartName(bodypart) 
            if bodypartName then 
                message = message.." ("..getBodyPartName(bodypart)..")" 
            end 
        end 
        outputChatBox(message, root, r, g, b) 
    end 
) 

Posted
  
local posLabel, posLabelShadow = createShadowedLabelFromSpare(posLeftDistance, y, 20, labelHeight, tostring(self.position) .. ')', 'right') 
  
-- and 
  
local playerLabel, playerLabelShadow = createShadowedLabelFromSpare(nameLeftDistance, y, 250, labelHeight, name .. time) 
  

this part add the dead player?

Posted

Labels don't support it by default, but you could search on the forums for the custom function.

Though, you'll have to adapt it, since the custom function creates many labels to simulate HEX codes.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...