Plate Posted May 27, 2012 Posted May 27, 2012 Hola otra ves Los usuarios del mi server me piden que haga resets (como los del zombie Hell party ) Se puede con el recurso exp_system Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 27, 2012 Posted May 27, 2012 Claro, pero vas a tener que crear tu propio sistema de resets, igual es muy facil usando las funciones de mi recurso. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted May 27, 2012 Author Posted May 27, 2012 esta bien hasta ahora ? function reset (player, command) setPlayerExp (thePlayer, 0) setPlayerLevel (thePlayer, 0) end Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 27, 2012 Posted May 27, 2012 Las funcions son exportadas de mi recurso, asi que tenes que usar: exports [ "exp_system" ]:function ( ) Porque usas "thePlayer" si tu argumento es "player"? estas pensando en lo que haces vos? P.D: es setPlayerEXP, con mayuscula "EXP". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted May 27, 2012 Author Posted May 27, 2012 buue mas o menos hay lo puse solid esta bien? exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (player, command) exports [ "exp_system" ]:setPlayerExp (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) end addCommandHandler ("Reset", reset ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 27, 2012 Posted May 27, 2012 Volve a leer mi post anterior y corregi los errores mencionados. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Soren Posted May 27, 2012 Posted May 27, 2012 exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (player, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) end addCommandHandler ("Reset", reset )
Castillo Posted May 27, 2012 Posted May 27, 2012 Eso aun tiene fallos. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted May 27, 2012 Posted May 27, 2012 Volve a leer mi post. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted May 27, 2012 Author Posted May 27, 2012 Bueno Funciono (gracias Soren y Solid ) pero no da nada en la columna Reset hay seria? exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 0) end addCommandHandler ("Reset", reset ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Soren Posted May 27, 2012 Posted May 27, 2012 Bueno Funciono (gracias Soren y Solid ) Dices enserio que funciono? No me lo esperaba. En cuanto a la columna usa un settimer para que cheque
Castillo Posted May 27, 2012 Posted May 27, 2012 Lo unico que estas haciendo ahi es reiniciar los datos, no estas aumentando los "resets". San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Soren Posted May 27, 2012 Posted May 27, 2012 Lo unico que estas haciendo ahi es reiniciar los datos, no estas aumentando los "resets". No es eso lo que queria?
Plate Posted May 28, 2012 Author Posted May 28, 2012 Soren puse el setTimer pero no funciona fijate capas que lo hise mal exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) end addCommandHandler ("Reset", reset ) setTimer(reset,1000,1) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 28, 2012 Posted May 28, 2012 @Soren: No, el quiere que al usar el comando, aumente el dato: "resets" en el scoreboard. @Plate: Estas mandando cualquiera, no tiene el menor sentido eso. Tenes que usar getElementData y setElementData. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Soren Posted May 28, 2012 Posted May 28, 2012 Soren puse el setTimer pero no funciona fijate capas que lo hise mal exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) end addCommandHandler ("Reset", reset ) setTimer(reset,1000,1) Yo no se bien eso de como maejar el score board
Plate Posted May 28, 2012 Author Posted May 28, 2012 me parece que me mande terriblemente cualquiera pero bue exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) local reset = getAccountData(account,"reset") if not reset then setAccountData(account,"reset",0) end setAccountData(account,"reset",tonumber(reset)+1) end addCommandHandler ("Reset", reset ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 28, 2012 Posted May 28, 2012 Estas intentando updatear la cuenta, no el data que aparecera en el scoreboard. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted May 28, 2012 Author Posted May 28, 2012 hay ? exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) local account = getPlayerAccount(source) if isGuestAccount(account) then return end local reset = getAccountData(account,"reset") if reset then setElementData(source,"reset",tostring(reset)) else setElementData(source,"reset",0) end end addCommandHandler ("Reset", reset ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Castillo Posted May 28, 2012 Posted May 28, 2012 Le seguis mandando cualquiera. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Plate Posted May 28, 2012 Author Posted May 28, 2012 no entiendo como se usa u.u el script va serverside? exports [ "scoreboard" ]:scoreboardAddColumn ( "reset" ) function reset (thePlayer, command) exports [ "exp_system" ]:setPlayerEXP (thePlayer, 0) exports [ "exp_system" ]:setPlayerLevel (thePlayer, 1) local reset = getElementData("reset") if not reset then setElementData("reset",0) end setElementData("reset",tonumber(reset)+1) end addCommandHandler ("Reset", reset ) Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Edikosh998 Posted May 28, 2012 Posted May 28, 2012 Aaaaaa...Porque intentas hacer esas cosas? Aunque el script vaya o no server-side, el tema es que, estas tratando de que Castillo te lo arregle (tirando al azar funciones). Lee que es una funcion, que devuelve. Que es un argumento, que tipos de argumentos hay. Lee que es una variable, y sus tipos. Lee sobre las condiciones. No entiendo la desesperacion de querer hacer algo tan avanzado. Hay que ir por pasos... Si vos pensas que esto solo te va a servir en el MTA, estas en otra. Porque hay miles de usos en la programacion, y por eso se pide mucho por eso. Igual, pienso que esto no lo leen y que seguramente vas a seguir preguntando lo mismo, creando otros topics, debes de capaz encontrarle la vuelta a cada problema. WRS( World Racing Server) [server] = 8%
Plate Posted May 28, 2012 Author Posted May 28, 2012 Me podrias dar un ejemplo SIMPLE de getElementData y de setElementData que no sea el de wiki Visita Full GameZ DayZ Mod Server IP: mtasa://158.69.125.144:29015
Edikosh998 Posted May 28, 2012 Posted May 28, 2012 Ok pero primero decime que es una funcion, que puede llegar a devolver. Y por otro lado, que son los argumentos. Si sabes eso, te doy un ejemplo de elementData. Porque , que facil es que te de un ejemplo para que luego lo copies y cambies una letrita. WRS( World Racing Server) [server] = 8%
Recommended Posts