depato123 Posted July 4, 2013 Posted July 4, 2013 Hola, encontre un recurso de "Givemoney" o "GiveCash" pero tuve muchos problemas porque los usuarios no sabían si en realidad el dinero les abría llegado y quería preguntar como puedo agregar un texto que diga "Tal usuario te ha dado $X" o sino "Te han dado $X" ¿Se podría lograr agregar eso al resource base? este es el script function givecash(thePlayer, command, who, amount) local noobwiegeldkrijgt = getPlayerFromName ( who ) local noobdiegeldgeeft = getPlayerFromName ( thePlayer ) givePlayerMoney (noobwiegeldkrijgt, math.abs(tonumber(amount))) takePlayerMoney (thePlayer, math.abs(tonumber(amount))) end addCommandHandler ("pagar", givecash)
Castillo Posted July 4, 2013 Posted July 4, 2013 Con ese scirpt, podes enviar dinero que no tengas, ya que no verificas si tiene el dinero o no. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 Con ese scirpt, podes enviar dinero que no tengas, ya que no verificas si tiene el dinero o no. ¿Como puedo solucionar eso?
Castillo Posted July 4, 2013 Posted July 4, 2013 Verifica si tiene el dinero primero usando getPlayerMoney. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 Creo que funcionó. ¿Ahora como puedo hacer eso de que el usuario que recibió el dinero le aparezca "Te han dado $Cantidad"
Castillo Posted July 4, 2013 Posted July 4, 2013 outputChatBox Tambien verifica si el monto es mayor que 0, ya que pueden hacer: /pagar Castillo -999999999999999 y se les apareceria dinero a ellos mismos. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 outputChatBox Tambien verifica si el monto es mayor que 0, ya que pueden hacer: /pagar Castillo -999999999999999 y se les apareceria dinero a ellos mismos. /Pagar Castillo -999999999999999 ¿Pero como puedo especificar que cuando Castillo reciba los -999999999999999 le aparezca el mensaje?
Castillo Posted July 4, 2013 Posted July 4, 2013 Despues de takePlayerMoney pones el mensaje y listo. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 Pero lo dice a todo el server, no solo a el que recibió el dinero
Castillo Posted July 4, 2013 Posted July 4, 2013 Postea como lo pusiste. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 Postea como lo pusiste. function givecash(thePlayer, command, who, amount) local money = getPlayerMoney(thePlayer) if (money > 0) then local noobwiegeldkrijgt = getPlayerFromName ( who ) local noobdiegeldgeeft = getPlayerFromName ( thePlayer ) givePlayerMoney (noobwiegeldkrijgt, math.abs(tonumber(amount))) takePlayerMoney (thePlayer, math.abs(tonumber(amount))) outputChatBox ( "xD", getRootElement(), 255, 255, 255, true ) end end addCommandHandler ("pagar", givecash)
Castillo Posted July 4, 2013 Posted July 4, 2013 Cambia getRootElement() por noobwiegeldkrijgt. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
Castillo Posted July 4, 2013 Posted July 4, 2013 No, estas verificando si el dinero del jugador es mayor que 0, pero no si tiene el dinero que intenta dar. San Andreas Utopia RPG (SAUR) Owner & Developer. Education is the most powerful weapon which you can use to change the world.
depato123 Posted July 4, 2013 Author Posted July 4, 2013 outputChatBox ( "Has recibido", noobwiegeldkrijgt, 255, 255, 255, true ) No aparece ningun texto
Recommended Posts