SHARE
TWEET

Untitled

a guest May 19th, 2017 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dcmd_withdraw(playerid,params[])
  2. {
  3.     new wamount,string[256];
  4.     new bank = bmoney[playerid];
  5.     if(bank <= wamount) return SendClientMessage(playerid,COLOUR_RED,"Error: You can't withdraw that much money");
  6.     else if(sscanf(params,"u",wamount)) return SendClientMessage(playerid,COLOUR_RED,"Usage: /withdraw [money amount]");
  7.     else if(wamount <= 0) return SendClientMessage(playerid,COLOUR_RED,"Error: You can't withdraw under 1$!");
  8.     else
  9.     {
  10.         bmoney[playerid] -= wamount;
  11.         GivePlayerMoney(playerid, wamount);
  12.         format(string,sizeof(string),"You withdrawed $%d",wamount);
  13.         SendClientMessage(playerid,COLOUR_GREEN,string);
  14.         return 1;
  15.     }
  16. }
  17. dcmd_deposit(playerid,params[])
  18. {
  19.     new amount,string[256];
  20.     bmoney[playerid] += amount;
  21.     new currentm = GetPlayerMoney(playerid);
  22.     if(currentm <= amount) return SendClientMessage(playerid,COLOUR_RED,"Error: You do not have that much cash");
  23.     else if(sscanf(params,"u",amount)) return SendClientMessage(playerid,COLOUR_RED,"Usage: /deposit [money amount]");
  24.     else if(amount <=0) return SendClientMessage(playerid,COLOUR_RED,"Error: You can't deposit under 1$!");
  25.     else
  26.     {
  27.         format(string,sizeof(string),"You deposited $%d",amount);
  28.         SendClientMessage(playerid,COLOUR_GREEN,string);
  29.         GivePlayerMoney(playerid, -amount);
  30.         return 1;
  31.     }
  32. }
RAW Paste Data
Challenge yourself this year...
Learn something new in 2017
Top