Skip to content

Instantly share code, notes, and snippets.

@DouglasSherk
Created April 13, 2017 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DouglasSherk/57b6a9cd59b48f6f0deff61b53271247 to your computer and use it in GitHub Desktop.
Save DouglasSherk/57b6a9cd59b48f6f0deff61b53271247 to your computer and use it in GitHub Desktop.
ARP - Withdrawing from a user's bank account
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