Created
April 13, 2017 20:04
-
-
Save DouglasSherk/57b6a9cd59b48f6f0deff61b53271247 to your computer and use it in GitHub Desktop.
ARP - Withdrawing from a user's bank account
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
new amount = str_to_num(request) | |
new bank = ARP_GetUserBank(id) | |
if (amount < 1) { | |
client_print(id, print_chat, "[ARP] Invalid amount; please enter a whole number.") | |
return PLUGIN_HANDLED | |
} | |
if (amount > bank) { | |
client_print(id, print_chat, "[ARP] You do not have enough money in your bank account.") | |
return PLUGIN_HANDLED | |
} | |
ARP_SetUserWallet(id, ARP_GetUserWallet(id) + amount) | |
ARP_SetUserBank(id, bank - amount) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment