Admigo Posted September 10, 2011 Share Posted September 10, 2011 Heey All, If you die you see deadmessage in white and with hexcolour if u use it in name. I want to delete the hex color code and change the color of the name if you use hex color. So if i am #FFFF00Admigo And i die you see Admigo in yellow in deathmessage. Here is the code: 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 else 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 ) Thnks Admigo Link to comment
bandi94 Posted September 10, 2011 Share Posted September 10, 2011 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 else 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,true) end ) Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 Dont work. Its something in meta i think. <setting name="*color" value="#ffaa00" /> <setting name="*show_bodypart" value="[true]" /> <setting name="*show_weapon" value="[true]" /> <setting name="*show_vehiclename" value="[true]" /> Link to comment
Castillo Posted September 10, 2011 Share Posted September 10, 2011 You'll have to edit the drawing part, there's a function called dxDrawColorText in this forum, search for it, then use that instead of dxDrawText. Link to comment
Admigo Posted September 10, 2011 Author Share Posted September 10, 2011 I deleted in meta so now my colour show up if i die. Only i need to delete the hex colour in deathmessage. Fix pls. 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