Jump to content

Change_somthing


Recommended Posts

Posted
Like that :D
addEventHandler('onPlayerChat', getRootElement(), 
    function(msg, type) 
        if type == 2 then 
            cancelEvent() 
            local r, g, b = getPlayerNametagColor(source) 
            for placeNumber, playerData in ipairs(getPlayersInTeam(getPlayerTeam(source))) do 
                outputChatBox("#FF0000(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
            end 
        end 
    end 
) 
function RGBToHex(red, green, blue) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then 
        return 
    end 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
end 

Hmm..No.

Use my first code and add to it the RGBToHex code.

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Posted
i need ready made please because i tried every thing
local function onplayerChat ( message, messageType ) 
    if ( messageType == 2 ) then 
        cancelEvent ( ) 
        local name = getPlayerName ( source ) 
        local red, green, blue = getPlayerNametagColor ( source ) 
        local hex = RGBToHex ( red, green, blue ) 
  
        local members = getPlayersInTeam( team ) or {} 
        for _, player in ipairs(members) do 
            outputChatBox( "#FFFFFF(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) 
        end 
        outputServerLog( "(TEAM): " .. name .. ": " .. message ) 
    end 
end 
addEventHandler ( "onPlayerChat", root, onplayerChat ) 

For you Nikolai itsnot Working at all its not showing any thing , i mean itsnot showing (CLAN) OR (TEAM) it makes space

in outputChatBox

Heeeeeeeeeeeelp

Then what the hell is this code? huh

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted

like that ???

local function onplayerChat ( message, messageType ) 
    if ( messageType == 2 ) then 
        cancelEvent ( ) 
        local name = getPlayerName ( source ) 
        local red, green, blue = getPlayerNametagColor ( source ) 
        local hex = RGBToHex ( red, green, blue ) 
  
        local members = getPlayersInTeam( team ) or {} 
        for _, player in ipairs(members) do 
             outputChatBox("#00FF00(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
        end 
        outputServerLog( "(TEAM): " .. name .. ": " .. message ) 
    end 
end 
addEventHandler ( "onPlayerChat", root, onplayerChat ) 
  
function RGBToHex(red, green, blue) 
    if((red < 0 or red > 255 or green < 0 or green > 255 or blue < 0 or blue > 255)) then 
        return nil 
    end 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
end 

My nick in MTA is Spider

Posted

What Do you mean like that :( ?

outputChatBox("#00FF00(CLAN)..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
 

My nick in MTA is Spider

Posted
outputChatBox( "#FFFFFF(CLAN)" .. hex.." "..name .. ":#FFFFFF" .. message, player, 255, 255, 255, true ) 

His, not mine.

Didn't notice it, I was on phone..

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

Posted (edited)

If it didn't worked, don't expect from me to help you again..

Removed

Edited by Guest

If you're looking for a cheap paid scripter, don't hesitate to contact me.

Great minds discuss ideas, Average minds discuss events and small minds discuss people.

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