Jump to content

¿Como puedo modificar este recurso?


Recommended Posts

Posted

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) 

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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?

Posted

Despues de takePlayerMoney pones el mensaje y listo.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

Postea como lo pusiste.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted
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) 

Posted

Cambia getRootElement() por noobwiegeldkrijgt.

San Andreas Utopia RPG (SAUR) Owner & Developer.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

Posted

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.

560x95_FFFFFF_FF9900_000000_000000.png

Education is the most powerful weapon which you can use to change the world.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...