Alexs Posted July 10, 2012 Posted July 10, 2012 Hola a Todos, tengo este script: function setPlayerZombieKills ( playerSource, jugador, zkills ) local cuenta = getAccountName(getPlayerAccount ( playerSource )) if ( jugador ) and ( cuenta == "Alexs_Steel" ) then local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then return setAccountData ( account, "Zombie kills", tonumber(zkills) ) else return false end end end Me dice que el argumento 1 de getPlayerAccount no es un Elemento si no el comando que utilizo Developer @ MYVAL
Castillo Posted July 10, 2012 Posted July 10, 2012 Ese script no tiene mucho sentido para mi. Como ejecutas la funcion? San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 10, 2012 Author Posted July 10, 2012 con un comando: addCommandHandler("zkills", setPlayerZombieKills) Developer @ MYVAL
Castillo Posted July 10, 2012 Posted July 10, 2012 El segundo argumento de addCommandHandler es el comando que se uso, ademas tenes que usar getPlayerFromName para obtener el elemento del jugador de un nombre. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 10, 2012 Author Posted July 10, 2012 function setPlayerZombieKills ( playerSource, commandName, jugador, zkills ) local cuenta = getAccountName(getPlayerAccount( playerSource )) if ( jugador ) and (zkills) and ( cuenta == "Alexs_Steel" ) then local account = getPlayerAccount ( getPlayerFromName(jugador) ) if ( account and not isGuestAccount ( account ) ) then setAccountData( account, "Zombie kills", tonumber(zkills) ) setElementData(account, "Zombie kills", getAccountData(account), "Zombie kills") else return false end end end addCommandHandler("zkills", setPlayerZombieKills) Intente asi, pero no me pone los zombies del Scoreboard en el numero que pongo en (zkills) Developer @ MYVAL
Castillo Posted July 10, 2012 Posted July 10, 2012 function setPlayerZombieKills ( playerSource, commandName, jugador, zkills ) local cuenta = getAccountName ( getPlayerAccount ( playerSource ) ) if ( jugador ) and ( zkills ) and ( cuenta == "Alexs_Steel" ) then local jugador = getPlayerFromName ( jugador ) local account = getPlayerAccount ( jugador ) if ( account and not isGuestAccount ( account ) ) then setAccountData ( account, "Zombie kills", tonumber ( zkills ) ) setElementData ( jugador, "Zombie kills", tonumber ( zkills ) ) end end end addCommandHandler ( "zkills", setPlayerZombieKills ) San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Alexs Posted July 10, 2012 Author Posted July 10, 2012 Ya lo habia resuelto, pero en nombre de los que le interese el comando, Gracias Developer @ MYVAL
Castillo Posted July 10, 2012 Posted July 10, 2012 Ok, me alegro que lo hayas podido resolver solo. De nada. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Recommended Posts