Alexs Posted July 4, 2012 Posted July 4, 2012 Hola a Todos, Queria saber como consigo la vida de un jugador con un setTimer sin usar eventos que lo tengan en source, Quiza no me explico bien, quiero saber como hacer esto: function infectando ( ) setElementData(thePlayer, "nivel.infeccion", 0 ) end setTimer ( infectando, 30000, 0) Ya que asi me dice que "thePlayer" es nil Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 function infectando ( ) for index, thePlayer in ipairs ( getElementsByType ( "player" ) ) do setElementData ( thePlayer, "nivel.infeccion", 0 ) end end setTimer ( infectando, 30000, 0 ) Eso querias decir? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Si no me equivoco eso los afectaria a todos, para eso se que puedo usar esa funcion, pero si lo que deseo es afectar a un solo jugador especificamente? Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 Si no tenes un elemento, nunca va a funcionar. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 mm... algun consejo para conseguirlo como elemento?? pensaba en usar su IP o su Serial con onPlayerJoin, pero pensaba en que esta puede variar Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 El serial? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Si, es que es lo que no puede variar, pero veo que solo se podria con "getPlayerFromName" pero este se puede cambiar, alguna otra manera de conseguir un elemento de jugador que no varie? Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 Es que no entiendo que queres hacer, podrias especificar? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Cierto, dejame expresarme lo mejor que pueda: Quiero conseguir un elemento de jugador que no sea una variable del evento como "source", ya que no uso un evento si no un setTimer, usaria getElementsByType pero solo quiero afectar a un jugador, Que utilizo para eso? Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 Podes hacerlo client side. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Mientras esperaba tu respuesta se me ocurrio usar getPlayerAccount --Para conseguir la cuenta al loggear getAccountPlayer --Para conseguir al jugador en el Timer Deberia resultar si lo intento, verdad? Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 getAccount + getAccountPlayer San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Para "getAccount" necesito su username, que pasaria si este cambia?? Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 Necesitas el nombre de la cuenta, si cambia, bueno... te jodes. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 Utilize lo qque te dije de getPlayerAccount + getAccountPlayer y el debugscript se callo :B Developer @ MYVAL
Castillo Posted July 4, 2012 Posted July 4, 2012 getPlayerAccount se usa para obtener la cuenta de UN JUGADOR, no para obtener UNA CUENTA que es lo que necesitas claro. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 4, 2012 Author Posted July 4, 2012 El problema con getAccount esta en el cambio de nombre, asi que usare getPlayerName + getPlayerFromName y pondre un Anti Cambio de Nick. Developer @ MYVAL
Recommended Posts