Jump to content

# problem with my code


☠ RaZeR ☠

Recommended Posts

hi guys

ihave code that replace (Team) to Gang

and i have code that replace teamsay to Chat

but it dosent work { when i writte on the "y" the word dosent display }

bindKey(source, "y", "down", "chatbox", "FOY.Chat") 
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|FOY Chat| :"..getPlayerName(source)..":#FFFFFF "..string.gsub(msg, "#%x%x%x%x%x%x", ""), playerData, r, g, b, true) 
            end 
        end 
    end) 

Link to comment
addEventHandler("onPlayerChat", root, function(msg, messageType) 
    if messageType == 2 then 
    cancelEvent() 
    local team = getPlayerTeam(source) 
    local r, g, b  = getPlayerNametagColor(source) 
        for _, member in ipairs( getPlayersInTeam(team) ) do 
            outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(source) .. ': #FFFFFF' .. msg:gsub('#%x%x%x%x%x%x', ''), member, r, g, b, true) 
        end 
    end 
end) 

Link to comment
function FOYChat ( thePlayer, _, ... ) 
    local message = table.concat ( { ... }, " " ) 
    local team = getPlayerTeam(thePlayer) 
    local r, g, b  = getPlayerNametagColor(thePlayer) 
        for _, member in ipairs( getPlayersInTeam(team) ) do 
            outputChatBox('#00FF00|FOY Chat| :' .. getPlayerName(thePlayer) .. ': #FFFFFF' .. message, member, r, g, b, true) 
        end 
    end 
end) 
addCommandHandler ( "FOYChat", FOYChat ) 
  
addEventHandler ( 'onPlayerJoin', getRootElement(), 
function () 
bindKey(source,"y","down","chatbox","FOYChat") 
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...