Transfer Money

Discussion in 'CommandHelper' started by Sketsi, Sep 19, 2017.

  1. Sketsi

    Sketsi New Member

    So when players switch their names, all of their money gets reset, ofcourse this is a simple task to check the amount and retype it, but figured why not create a shortcut! But my issue is when I try to add or subtract mums(server currency) between accounts, it does nothing at all. Was wondering if someone could take a look at this and possibly help me out a bit.

    /transfer $oldname $newname = >>>
    @oldbalance = acc_balance($oldname)
    msg(concat(color(green), $newname, ' started with ', acc_balance($newname), ' mums.'))
    msg(concat(color(aqua), $oldname, ' started with ', acc_balance($oldname), ' mums.'))
    acc_add('$newname', @oldbalance)
    msg(concat(color(green), $newname, ' now has ', acc_balance($newname), ' mums.'))
    acc_set('$oldname', 0)
    msg(concat(color(aqua), $oldname, ' now has ', acc_balance($oldname), ' mums.'))

  2. PseudoKnight

    PseudoKnight Well-Known Member

    You can use a UUID instead of a player name for the Vault functions.