Jump to content

como hago una columna en scoreboard


iFoReX

Recommended Posts

Que esta mal ?

exports [ "scoremota" ]:scoreboardAddColumn ( "ip" ) 
  
function IP() 
    local account = getPlayerAccount(source) 
    if isGuestAccount(account) then return end 
    local ip = getAccountData(account,"ip") 
    if not ip then setAccountData(account,"ip",Cargando)  
    end 
    setAccountData(account,"ip",tonumber(getPlayerIP(source))) 
end 
  
  
addEventHandler("onPlayerLogin",root, 
function () 
    local account = getPlayerAccount(source) 
    if isGuestAccount(account) then return end 
    local ip = getAccountData(account,"ip") 
    if ip then 
        setElementData(source,"ip",tostring(getPlayerIP(source))) 
    else 
        setElementData(source,"ip",Cargando)     
end 
end) 

no me aparece nada en la columna :/

Link to comment
exports [ "scoremota" ]:scoreboardAddColumn ( "ip" ) 
  
function IP() 
ip = getPlayerIP ( source ) 
setElementData ( source, "ip", ip ) 
   end 
end 
addEventHandler ( "onPlayerJoin", getRootElement(), IP ) 

Intenta asi...

Link to comment

Entonces que tiene quever las funciones de cuenta con eso??

addEventHandler ( "onResourceStart", resourceRoot, 
    function ( ) 
        exports [ "scoremota" ]:scoreboardAddColumn ( "ip" ) 
  
        for index, player in ipairs ( getElementsByType ( "player" ) ) do 
            setElementData ( player, "ip", getPlayerIP ( player ) ) 
        end 
    end 
) 
  
addEventHandler ( "onPlayerJoin", root, 
    function ( ) 
        setElementData ( source, "ip", getPlayerIP ( source ) ) 
    end 
) 

Link to comment
  • Recently Browsing   0 members

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