iFoReX Posted May 19, 2012 Share Posted May 19, 2012 ? como la hago se q con esta funcion getPlayerIP pero con que mas ? Link to comment
Castillo Posted May 19, 2012 Share Posted May 19, 2012 setElementData Recuerda que necesitas agregar el recurso al ACL.xml para darle permiso a la funcion getPlayerIP. Link to comment
iFoReX Posted May 19, 2012 Author Share Posted May 19, 2012 ok eso, y como se hacia eso para exportar la columna ? Link to comment
Castillo Posted May 19, 2012 Share Posted May 19, 2012 exports [ "scoreboard" ]:scoreboardAddColumn ( "IP" ) Link to comment
iFoReX Posted May 19, 2012 Author Share Posted May 19, 2012 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
Alexs Posted May 19, 2012 Share Posted May 19, 2012 exports [ "scoremota" ]:scoreboardAddColumn ( "ip" ) function IP() ip = getPlayerIP ( source ) setElementData ( source, "ip", ip ) end end addEventHandler ( "onPlayerJoin", getRootElement(), IP ) Intenta asi... Link to comment
iFoReX Posted May 19, 2012 Author Share Posted May 19, 2012 Quiero que la IP se ponga en el tab , no funciona alexs Link to comment
Alexs Posted May 19, 2012 Share Posted May 19, 2012 Tu scoreboard se llama Scoremota?? Link to comment
Castillo Posted May 19, 2012 Share Posted May 19, 2012 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
iFoReX Posted May 19, 2012 Author Share Posted May 19, 2012 Muuuchas gracias solid es que era mi primera vez haciendo un script de scoreboard Link to comment
Recommended Posts