Jump to content

Change_somthing


Recommended Posts

Posted
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

  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

Posted (edited)
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
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

Posted

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!

Posted (edited)
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
Posted

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

Posted
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?

Posted

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 ,

Posted
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

Stop blaming him, It's nof his fault, It's yours because you don't know how to fix it or ateast just tell what does debug say.

Read my post again.

Posted
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?

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

Posted

Add this to my old 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 

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

Posted
OmG finally it works thank you very much guys :)

you really need to know how to script , trust me , it's not that hard if you have a littel bit of english language ,

Don't expect others to help you in the next days , , ,

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

Posted

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 
) 

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

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

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

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