Antharaz 93 Posted February 23, 2010 Report Share Posted February 23, 2010 Podem reparar que ao utilizarem a função doPlayerWithdrawMoney no console aparece um erro e o dinheiro não é transferido... Como arrumar: Abra o arquivo 050-function da pasta data/lib e reparem esta parte: function doPlayerWithdrawMoney(cid, amount) if(not getBooleanFromString(getConfigInfo('bankSystem'))) then return false end local balance = getPlayerBalance(cid) if ((amount > balance) or not (doPlayerAddMoney(cid, amount))) then return false end doPlayerSetBalance(cid, balance - amount) return true end Problema: O server interpreta o amount como uma string(tipo texto) e não consegue fazer a comparação com o balance que é do tipo number(número), então usamos a função tonumber() para transformar a string em number, ou seja, substitua a parte de vermelho por tonumber(amount) ficando assim: function doPlayerWithdrawMoney(cid, amount) if(not getBooleanFromString(getConfigInfo('bankSystem'))) then return false end local balance = getPlayerBalance(cid) if ((tonumber(amount) > balance) or not (doPlayerAddMoney(cid, amount))) then return false end doPlayerSetBalance(cid, balance - amount) return true end E voalá... funciona =D Se postarem em outros lugares postem os créditos Link to comment https://xtibia.com/forum/topic/128809-removendo-erro-withdraw-tfs-e-tcs/ Share on other sites More sharing options...
matheusrp 0 Posted June 13, 2010 Report Share Posted June 13, 2010 (edited) Cara, o meu serve ta com bug de quando voce da !withdraw -10000 mesmo o player não tendo ganha o dinheiro :S o que eu posso fazer? Valeu abraços! Edited June 13, 2010 by matheusrp Link to comment https://xtibia.com/forum/topic/128809-removendo-erro-withdraw-tfs-e-tcs/#findComment-889771 Share on other sites More sharing options...
Recommended Posts