Jump to content

Change_somthing


Recommended Posts

addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
        if type == 2 then 
            cancelEvent() 
            local r, g, b = getPlayerNametagColor(source) 
            for placeNumber, playerData in ipairs(getPlayersInTeam(getPlayerTeam(source))) do 
                outputChatBox(getPlayerName(source) .. '(CLAN)' .. msg:gsub('#%x%x%x%x%x%x', ''), playerData, r, g, b, true) 
            end 
        end 
    end 
) 

Too bored to explain, sorry guys x3

Link to comment
  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

addEventHandler('onPlayerChat', g_Root, 
    function(msg, type) 
        if type == 2 then 
            cancelEvent() 
            local r, g, b = getPlayerNametagColor(source) 
            for placeNumber, playerData in ipairs(getPlayersInTeam(getPlayerTeam(source))) do 
                outputChatBox(getPlayerName(source) .. '(CLAN)' .. msg:gsub('#%x%x%x%x%x%x', ''), playerData, r, g, b, true) 
            end 
        end 
    end 
) 

Too bored to explain, sorry guys x3

This No Effect

Edited by Guest
Link to comment
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

Link to comment

You don't even know what you are doing or what? You say there are absolutly no debugescript 3 error? It actually gives the error that RGBToHex is a nil value, in other words: This code/function was not found. Also, it doesn't give any 'space' to the chatbox, because that error is given. You said you tried everything, but you don't even know what you are doing!

Link to comment
You don't even know what you are doing or what? You say there are absolutly no debugescript 3 error? It actually gives the error that RGBToHex is a nil value, in other words: This code/function was not found. Also, it doesn't give any 'space' to the chatbox, because that error is given. You said you tried everything, but you don't even know what you are doing!

I told you. ;)

And spider since you don't know how to use it then no need to help you...

onPlayerChat is serverside.

Add this to your code.

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 

Edited by Guest
Link to comment

Nikolai i know that its in Server Side itsn't showing (CLAN) it shows (TEAM)

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 ) 

This is in Server Side but no effect

Link to comment
your script isn't working -_- you gave me my posted script again ! iam asking for help if you want okay if you don't so go away

Lol, why it does work on my server then? It gives me an error, and totally no output in the chatbox. Is the script even started, lol?

Link to comment

Try This ,

function onplayerChat ( message, messageType ) 
    if ( messageType == 2 ) then 
        cancelEvent ( ) 
        local name = getPlayerName ( source ) 
        red ,green ,blue = getTeamColor(getPlayerTeam(source)) 
        outputChatBox( "#FFFFFF(CLAN)" .. red, green, blue.." "..name .. ":#FFFFFF" .. message, source, 255, 255, 255, true ) 
            end 
          end 
addEventHandler ( "onPlayerChat", root, onplayerChat ) 

Make sure you dont start gamemode play in server try test it with deathmatch gamemode or race ,

Link to comment
Try This ,
function onplayerChat ( message, messageType ) 
    if ( messageType == 2 ) then 
        cancelEvent ( ) 
        local name = getPlayerName ( source ) 
        red ,green ,blue = getTeamColor(getPlayerTeam(source)) 
        outputChatBox( "#FFFFFF(CLAN)" .. red, green, blue.." "..name .. ":#FFFFFF" .. message, source, 255, 255, 255, true ) 
            end 
          end 
addEventHandler ( "onPlayerChat", root, onplayerChat ) 

Make sure you dont start gamemode play in server try test it with deathmatch gamemode or race ,

Where is the loop for team members?

Link to comment
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("(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
            end 
        end 
    end 
) 

Here.

Link to comment
OmG finally it works thank you very much guys :)

Good, but by your next script I'm not going to help you anymore. Unless you are not bothered with posting what debugscript 3 says and you look by yourself into the code's of yourself and ours. Try to actually learn from it.

Link to comment
OmG finally it works thank you very much guys :)

Good, but by your next script I'm not going to help you anymore. Unless you are not bothered with posting what debugscript 3 says and you look by yourself into the code's of yourself and ours. Try to actually learn from it.

Also me.

As far as i know him he will post back that it's not working or something.

Link to comment

Hahahahah Nah but i have another question on that i put the Green Color Code Before the CLAN , but Every thing changes to green i wanna just the Clan be Green, xD itsn't important if you don't want to tell me :)

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("#00FF00(CLAN)"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
            end 
        end 
    end 
) 

Link to comment
Hahahahah Nah but i have another question on that i put the Green Color Code Before the CLAN , but Every thing changes to green i wanna just the Clan be Green, xD itsn't important if you don't want to tell me :)
code 

Now you can compare Nikolai96's code from RGBToHex with this one. Good luck.

Link to comment
Hahahahah Nah but i have another question on that i put the Green Color Code Before the CLAN , but Every thing changes to green i wanna just the Clan be Green, xD itsn't important if you don't want to tell me :)
code 

Now you can compare Nikolai96's code from RGBToHex with this one. Good luck.

OmG finally it works thank you very much guys :)

Good, but by your next script I'm not going to help you anymore. Unless you are not bothered with posting what debugscript 3 says and you look by yourself into the code's of yourself and ours. Try to actually learn from it.

Also me.

As far as i know him he will post back that it's not working or something.

Told you ;D

Then use what i posted before.

Link to comment

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 nil 
    end 
    return string.format("#%.2X%.2X%.2X", red, green, blue) 
end 

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