Alexs Posted July 10, 2012 Share 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 Link to comment
Castillo Posted July 10, 2012 Share Posted July 10, 2012 Ese script no tiene mucho sentido para mi. Como ejecutas la funcion? Link to comment
Alexs Posted July 10, 2012 Author Share Posted July 10, 2012 con un comando: addCommandHandler("zkills", setPlayerZombieKills) Link to comment
Castillo Posted July 10, 2012 Share 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. Link to comment
Alexs Posted July 10, 2012 Author Share 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) Link to comment
Castillo Posted July 10, 2012 Share 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 ) Link to comment
Alexs Posted July 10, 2012 Author Share Posted July 10, 2012 Ya lo habia resuelto, pero en nombre de los que le interese el comando, Gracias Link to comment
Castillo Posted July 10, 2012 Share Posted July 10, 2012 Ok, me alegro que lo hayas podido resolver solo. De nada. Link to comment
Recommended Posts