Jump to content

export function


Klesh

Recommended Posts

Hello i want this script to allow hexadecimal colors, it show's grey:

addEvent ("onClientPlayerKillMessage",true) 
function onClientPlayerKillMessage ( killer,weapon,wr,wg,wb,kr,kg,kb,width,resource ) 
    if wasEventCancelled() then return end 
    outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) 
end 
addEventHandler ("onClientPlayerKillMessage",getRootElement(),onClientPlayerKillMessage) 
  
function outputKillMessage ( source, wr,wg,wb,killer,kr,kg,kb,weapon,width,resource ) 
    if not iconWidths[weapon] then  
        if type(weapon) ~= "string" then 
            weapon = 999  
        end 
    end 
    local killerName 
    local wastedName 
    if not tonumber(wr) then wr = 255 end 
    if not tonumber(wg) then wg = 255 end 
    if not tonumber(wb) then wb = 255 end 
    if not tonumber(kr) then kr = 255 end 
    if not tonumber(kg) then kg = 255 end 
    if not tonumber(kb) then kb = 255 end 
    if ( source ) then 
        if isElement ( source ) then 
            if getElementType ( source ) == "player" then  
                wastedName = getPlayerName ( source ) 
            else  
            outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) 
            return false end 
        elseif type(source) == "string" then 
            wastedName = source 
        end 
    else  
        outputDebugString ( "outputKillMessage - Invalid 'wasted' player specified",0,0,0,100) 
    return false end 
    if ( killer ) then 
        if isElement ( killer ) then 
            if getElementType ( killer ) == "player" then 
                killerName = getPlayerName ( killer ) 
            else  
                outputDebugString ( "outputKillMessage - Invalid 'killer' player specified",0,0,0,100) 
            return false end 
        elseif type(killer) == "string" then 
            killerName = killer 
        else 
            killerName = "" 
        end 
    else killerName = "" end 
    --create the new text 
    if not killerName then 
      killerName = killerName:gsub("#%x%x%x%x%x%x", "") 
    end 
    return outputMessage ( {killerName, {"padding",width=3}, {"icon",id=weapon}, 
        {"padding",width=3},{"color",r=wr,g=wg,b=wb}, wastedName}, 
        kr,kg,kb ) 
        killerName = killerName:gsub("#%x%x%x%x%x%x", "") 
end 

edit : New way but the message shows in grey.

Edited by Guest
Link to comment

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...