Jump to content

Gang system [TaG]


PhantomDamn

Recommended Posts

Posted

hay alguna forma de hacer que cuando un player entre a un clan con el gang system de Solid se le agregue la tag del clan

por ejemplo mi nick es "Damn" y al entrar al clan [CoD] en el chat aparezca como "[CoD]Damn", pero mi nick sigue siendo "Damn"?

Posted

Prueba esto y hay vas agregando

Server:

addEventHandler ( "onPlayerChat", root, 
function ( message, type ) 
local gangtag = getPlayerTeam(source) 
if (gangtag == "Clan 1") then 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "[Clan 1] " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) 
elseif (gangtag == "Clan 2") then 
    local r, g, b = getPlayerNametagColor(source) 
    outputChatBox ( "[Clan 2] " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) 
end 
end) 

Posted

una cosa es getPlayerTeam y otra cosa es getTeamName

lo otro, debees usar un cancelEvent y chekar si el msg type es team, main o /me

de otra forma se mostraran 2 textos al hablar, uno con el chat default y otro con tu codigo

Posted

Ya venia venir lo del cancelEvent() e.e, Aca corregido:

addEventHandler ( "onPlayerChat", root, 
function ( message, type ) 
local gangtag = getPlayerTeam(source) 
local teamname = getTeamName(source) 
if (gangtag == "Clan 1") then 
    local r, g, b = getPlayerNametagColor(source) 
   cancelEvent() 
    outputChatBox ( "[".. teamname .."] " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) 
elseif (gangtag == "Clan 2") then 
    local r, g, b = getPlayerNametagColor(source) 
  cancelEvent() 
    outputChatBox ( "[".. teamname .."] " .. getPlayerName(source) .. ": " .. message, getRootElement(), r, g, b, true ) 
end 
end) 

Posted

Creo que la key es gang, prueba con:

addEventHandler('onPlayerChat', getRootElement(), 
    function(msg, type) 
        if type == 0 then 
            cancelEvent() 
            local gang = getElementData( source, "gang" ) 
            local r, g, b = getPlayerNametagColor( source ) 
            outputChatBox( gang .. getPlayerName( source ) .. ': ' .. msg, root, r, g, b, true ) 
        end 
    end 
) 

Posted

Ahí le puse para que salga en blanco:

addEventHandler('onPlayerChat', getRootElement(), 
    function(msg, type) 
        if type == 0 then 
            cancelEvent() 
            local gang = getElementData( source, "gang" ) 
            local r, g, b = getPlayerNametagColor( source ) 
            outputChatBox( gang .. getPlayerName( source ) .. ': #FFFFFF' .. msg, root, r, g, b, true ) 
        end 
    end 
) 

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...