Jump to content

Search the Community

Showing results for tags 'bank withdraw'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Multi Theft Auto: San Andreas 1.x
    • Support for MTA:SA 1.x
    • User Guides
    • Open Source Contributors
    • Suggestions
    • Ban appeals
  • General MTA
    • News
    • Media
    • Site/Forum/Discord/Mantis/Wiki related
    • MTA Chat
    • Other languages
  • MTA Community
    • Scripting
    • Maps
    • Resources
    • Other Creations & GTA modding
    • Competitive gameplay
    • Servers
  • Other
    • General
    • Multi Theft Auto 0.5r2
    • Third party GTA mods
  • Archive
    • Archived Items
    • Trash

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Member Title


Gang


Location


Occupation


Interests

Found 1 result

  1. function withdraw(player,cmd,number) local number = tonumber(number) local bankbalance = tonumber(getElementData(player, "account:bankbalance")) or 0 if not tonumber(number) then outputChatBox("#27B86C[USE]: #ffffff/" .. cmd .. " [Ammount]", player, 38, 194, 129, true) else if tonumber(bankbalance) <= 0 then outputChatBox("#B1092D[Error]: #ffffffYour bank balance is 0.", player, 177,9,45, true) elseif bankbalance >= tonumber(number) then givePlayerMoney(player,tonumber(number)) setElementData(player, "account:bankbalance", bankbalance - number) else outputChatBox("#B1092D[Error] #ffffffYou dont have enough money.", player, 177,9,45, true) end end end addCommandHandler("withdraw",withdraw) The problem is, when i depositing some money, like $500, and when i withdrawing like this: /withdraw -555555555555 the server give me thats money. But when the account balance is 0, i can't withdraw negative amount. How can i stop that, when player wihtdrawing -$500000000000 when the balance is in negavite ? I want thats, player ONLY can withdraw thats money, what they have on the account.
×
×
  • Create New...