Hello, so I want to check if the sender has enough money (5000) using EconomyAPI but I don't know how can anyone help me? Also if they don't have enough money how can I close the ui?
i don't really know how the UI works exactly but for EconomyAPI: PHP: if(EconomyAPI::reduceMoney($sender, $amount) == EconomyAPI::RET_SUCCESS){ //Money successfully reduced from the sender account} else { //Player doesn't have enough of money}
please note that using that DEDUCTS the user's money it dosent checks it try doing myMoney(sender)>=5000
Use this to check if the player has 5000 or more. PHP: if(EconomyAPI::myMoney($sender) <= 5000){ // do something} else { // not enough money}