PhantomDamn Posted August 19, 2013 Posted August 19, 2013 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"?
AlvareZ_ Posted August 19, 2013 Posted August 19, 2013 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)
BorderLine Posted August 19, 2013 Posted August 19, 2013 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
AlvareZ_ Posted August 19, 2013 Posted August 19, 2013 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)
Sensacion Posted August 19, 2013 Posted August 19, 2013 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 )
PhantomDamn Posted August 19, 2013 Author Posted August 19, 2013 se puede hacer que el chat no saque el color del nick tambn?
Sensacion Posted August 19, 2013 Posted August 19, 2013 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 )
Recommended Posts