Narutimmy Posted June 19, 2012 Posted June 19, 2012 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 Ts3: thezombiworld.com:7777
Alexs Posted June 19, 2012 Posted June 19, 2012 usa las funciones exportadas de scoreborad y el setElementData Developer @ MYVAL
Narutimmy Posted June 19, 2012 Author Posted June 19, 2012 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 Ts3: thezombiworld.com:7777
Alexs Posted June 19, 2012 Posted June 19, 2012 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
Araa Posted June 20, 2012 Posted June 20, 2012 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.
Narutimmy Posted June 20, 2012 Author Posted June 20, 2012 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 Ts3: thezombiworld.com:7777
Edikosh998 Posted June 20, 2012 Posted June 20, 2012 1) Acordate de cambiar el nombre de la function (ponele "afk") 2) Va en server side WRS( World Racing Server) [server] = 8%
Narutimmy Posted June 20, 2012 Author Posted June 20, 2012 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 Ts3: thezombiworld.com:7777
explOdeR Posted June 20, 2012 Posted June 20, 2012 a ese script le falta por que lo mas probable es que salga false en el scoreboard..
Araa Posted June 20, 2012 Posted June 20, 2012 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.
explOdeR Posted June 20, 2012 Posted June 20, 2012 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
Narutimmy Posted June 21, 2012 Author Posted June 21, 2012 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 Ts3: thezombiworld.com:7777
BorderLine Posted June 21, 2012 Posted June 21, 2012 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
Narutimmy Posted June 21, 2012 Author Posted June 21, 2012 la verdad eso se complica un poco mas, porq con un cancelEvent y con un onClientPlayerDamage no funcionaya que los zombies usan setElementHealth A bueno, muchas Gracias ^^ mtasa://66.85.14.178:22003 Ts3: thezombiworld.com:7777
iFoReX Posted June 22, 2012 Posted June 22, 2012 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 elMota/elFoReX De Vuelta En MTA *---------* Cuenta De Youtube En La Que Subo Tutoriales Acerca De MTA :3 https://www.youtube.com/user/KillersGPs
BorderLine Posted June 22, 2012 Posted June 22, 2012 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
Recommended Posts