Klesh Posted January 12, 2012 Share Posted January 12, 2012 (edited) 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 January 12, 2012 by Guest Link to comment
Castillo Posted January 12, 2012 Share Posted January 12, 2012 That's just a mess, onZombieWasted -> server side and DX drawing functions are client side. Link to comment
Klesh Posted January 12, 2012 Author Share Posted January 12, 2012 Check the new one, it shows in grey with dxColoredText. Link to comment
Castillo Posted January 12, 2012 Share Posted January 12, 2012 According to what I know, "killmessages" uses Talidan's text library. You'll have to edit the text library script to add colored texts. Link to comment
Klesh Posted January 12, 2012 Author Share Posted January 12, 2012 Do you mean then i have to edit lib, with definition first of the dxdrawcoloredtext, replacing dxCreateTex it can work then? Link to comment
Castillo Posted January 12, 2012 Share Posted January 12, 2012 It's: dxDrawText, not dxCreateText. But yes, that was pretty much what I meant. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now