Jump to content

[Ayuda]Afk en Scoreboard


Recommended Posts

Posted

Hola, buenas tardes, bueno mi duda y solicitud es esta, como puedo aserle para colocar el Estado del AFK en el Scoreaborad? osea si el user usa /afk salga en el score que esta afk.

Gracias

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
usa las funciones exportadas de scoreborad y el
setElementData 

Alexs bueno no le entendi bien pero no se podria usar con esto

exports.dxscoreboard:addScoreboardColumn('Estado') 

eso aria la tabla no?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

emmm si usas dxscoreboard si, pero aun necesitas setElementData, el Scripting es genial e ilimitado, pero no magico para saber el estado asi como asi, crea la columna pero no la rellena

Developer @ MYVAL

Posted
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        setElementData ( player, "Estado", tostring(estado)) 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function goafk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("goafk", goafk) 

Usa, /goafk para cambiar de modo AFK a normal y de Normal a AFK.

Hi, this is a signature.

Posted
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        setElementData ( player, "Estado", tostring(estado)) 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function goafk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("goafk", goafk) 

Usa, /goafk para cambiar de modo AFK a normal y de Normal a AFK.

*-* Gracias y amm 2 preguntas:

1.- Si Cambio

addCommandHandler ("goafk", goafk) 

por

addCommandHandler ("afk", afk) 

sigue funcionando o no?

2.- Va en el Server o Cliente?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

Bueno lo puse asi

exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        setElementData ( player, "Estado", tostring(estado)) 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function goafk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("afk", goafk) 

en el Server.lua de el Scrip AFK que tenia, asi al escribir afk se pone en afk en el juego y ades se sincroniza con el del scoreboard, Gracias

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        if (estado) then 
            setElementData ( player, "Estado", tostring(estado)) 
        else 
            setElementData ( player, "Estado", "Normal") 
        end 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function goafk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("afk", goafk) 

Si, le faltaba un check para ver si tenia o no ElementData. Ya lo arregle.

Hi, this is a signature.

Posted

si entonces quedaria asi..

exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        if (estado) then 
            setElementData ( player, "Estado", tostring(estado)) 
        else 
            setElementData ( player, "Estado", "Normal") 
        end 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function afk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("afk", afk) 

puse la funcion como afk por que es mejor ''encuentro yo '' pero da exactamente lo mismo :3 pero eso es :3

Posted
exports [ "scoreboard" ]:addScoreboardColumn ("Estado", 3 ) 
function actualizarEstado() 
    for index, player in ipairs ( getElementsByType ( "player" ) ) do 
        estado = getElementData (player, "afk") 
        if (estado) then 
            setElementData ( player, "Estado", tostring(estado)) 
        else 
            setElementData ( player, "Estado", "Normal") 
        end 
    end 
end 
setTimer ( actualizarEstado, 2500, 0 ) 
  
function goafk (player, command) 
    data = getElementData (player, "afk") 
    if not (data == "AFK") then 
    setElementData (player, "afk", "AFK") 
    else 
    setElementData (player, "afk", "Normal") 
    end 
end 
addCommandHandler ("afk", goafk) 

Si, le faltaba un check para ver si tenia o no ElementData. Ya lo arregle.

wow., encerio muchas gracias *-*

otra peque Duda, hay manera para que estando AFK los Zombis no te agan Daño?

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

la verdad eso se complica un poco mas, porq con un cancelEvent y con un onClientPlayerDamage no funciona

ya que los zombies usan setElementHealth

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

Posted
la verdad eso se complica un poco mas, porq con un cancelEvent y con un onClientPlayerDamage no funciona

ya que los zombies usan setElementHealth

A bueno, muchas Gracias ^^

mtasa://66.85.14.178:22003

350x20_FFFFFF_FFFFFF_000000_000000.png

Ts3: thezombiworld.com:7777

350x20_FFFFFF_FFFFFF_000000_000000.png

Posted

narutimmy, podrias usar setTimer(setElementHealth, 100, 0, source, 100), con setElementFrozen( source, true ) o podrias usar setElementDimension( source, math.random(0,1000) ), o algo asi :P

elMota/elFoReX De Vuelta En MTA *---------*

Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3

https://www.youtube.com/user/KillersGPs

430x73_FFFFFF_FF9900_000000_000000.png
Posted

seria ideal que con respecto a lo que dice mota, y los jugadores no abusaran del afk para recobrar vida

usar getElementHealth para y despues de eso usar el setTimer,

Actual Nick: [XGN]BorderLine

Actual Clan: XLatino

Actual Status: Staff, Mod Level 1

(BOSS)Yakuza - [vS]Yakuza - [sXE]Yakuza - [uG]Yakuza - [FTLS]Racing - [XGN]Borderline

  • Recently Browsing   0 members

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