Jump to content

[Solucionado]Gang Tag


Mateito14

Recommended Posts

Hola, estuve haciendo para que en el chat aparezca la gang que eres y funciona, el problema es que si no eres de una gang aparece [None] y yo quiero que no aparezca nada xD.

elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
 cancelEvent() 
        local lvl = getElementData(source, "level") 
        local r, g, b = getPlayerNametagColor(source) 
        local gang = exports.gang_system:getPlayerGang ( source) 
        outputChatBox( "#FFFFFF["..gang.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true )  
        outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

Edited by Guest
Link to comment
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source) 
local gangTag 
if ( gang ) then 
gangTag = gang 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
else 
gangTag = "User" 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true )    
end 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

Link to comment
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source) 
local gangTag 
if ( gang ) then 
gangTag = gang 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
else 
gangTag = "User" 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true )    
end 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

No me funciono, gracias por responder ;).

Link to comment
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source) 
local gangTag 
if ( gang ) then 
gangTag = gang 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
else 
gangTag = "User" 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true )    
end 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

No me funciono, gracias por responder ;).

Lo veo bien lol.

elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source ) or "N/A" 
outputChatBox( "#FFFFFF["..gang.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

Link to comment
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source) 
local gangTag 
if ( gang ) then 
gangTag = gang 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
else 
gangTag = "User" 
outputChatBox( "#FFFFFF["..gangTag.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true )    
end 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

No me funciono, gracias por responder .

Lo veo bien lol.

elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
cancelEvent() 
local lvl = getElementData(source, "level") 
local r, g, b = getPlayerNametagColor(source) 
local gang = exports.gang_system:getPlayerGang ( source ) or "N/A" 
outputChatBox( "#FFFFFF["..gang.."] " .. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

Sigue apareciendo None :/

Link to comment

Esto te podria servir...

  
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
        cancelEvent() 
        local lvl = getElementData( source, "level" ) 
        local r, g, b = getPlayerNametagColor( source ) 
        local gang = exports.gang_system:getPlayerGang ( source) 
        if ( gang ~= "None" ) then                  -- Aqui compruebas que el gang del player sea diferente a 'None'. 
            tagGang = "#FFFFFF[" .. gang .. "] "    -- Si el 'getPlayerGang' retorna un resultado diferente a 'None', te saldra este tag. 
        else 
            tagGang = ""                            -- Y aqui, si el 'getPlayerGang' retorna 'None', simplemente no aparecera nada. 
        end 
        outputChatBox( tagGang.. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
        outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 
  

Link to comment
Esto te podria servir...
  
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
        cancelEvent() 
        local lvl = getElementData( source, "level" ) 
        local r, g, b = getPlayerNametagColor( source ) 
        local gang = exports.gang_system:getPlayerGang ( source) 
        if ( gang ~= "None" ) then                  -- Aqui compruebas que el gang del player sea diferente a 'None'. 
            tagGang = "#FFFFFF[" .. gang .. "] "    -- Si el 'getPlayerGang' retorna un resultado diferente a 'None', te saldra este tag. 
        else 
            tagGang = ""                            -- Y aqui, si el 'getPlayerGang' retorna 'None', simplemente no aparecera nada. 
        end 
        outputChatBox( tagGang.. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
        outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 
  

Me sirvió :D, muchas gracias.

Link to comment
elseif isObjectInACLGroup("user." .. getAccountName(getPlayerAccount(source)), aclGetGroup("Everyone")) then 
        cancelEvent() 
        local lvl = getElementData( source, "level" ) 
        local r, g, b = getPlayerNametagColor( source ) 
        local clan = getElementData(source, "gang" ) 
        if ( clan ~= "None" ) then                  
        tagclan = "#FFFFFF[" .. clan .. "] "     
        else 
        tagclan = "" 
        end 
        outputChatBox( tagclan.. getPlayerName ( source ) ..":#FFFFFF " .. text, getRootElement(), r, g, b, true ) 
        outputServerLog("CHAT: [user] " .. getPlayerName ( source ) .. ": " .. text) 

Link to comment
  • Recently Browsing   0 members

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