CMD:deposit(playerid,params[]) { new string[256]; new type; { if(sscanf(params, "d", type)) return SendClientMessage(playerid, -1, "[USAGE]: /deposit [amount]"); if(type == 0) if(GetPlayerMoney(playerid)< type) { GivePlayerMoney(playerid,-type); BankInfo[playerid][pBankAccount] += type; format(string, sizeof(string), "INFO: You have successfully deposited $%d to your bank account.", type); SendClientMessage(playerid, 0xFFFFFF, string); } else SendClientMessage(playerid, 0xFFFFFF, "SERVER: You do not have that much amount in your hand"); } return 1; } CMD:withdraw(playerid,params[]) { new string[256]; new type; { if(sscanf(params, "d", type)) return SendClientMessage(playerid, -1, "[USAGE]: /withdraw [amount]"); if(type == 0) if(BankInfo[playerid][pBankAccount] >= type) { BankInfo[playerid][pBankAccount] -= type; GivePlayerMoney(playerid, type); format(string, sizeof(string), "INFO: You have successfully withdrawn $%d from your bank account.", type); SendClientMessage(playerid, 0xFFFFFF, string); } else SendClientMessage(playerid, 0xFFFFFF, "SERVER: You do not have that much amount in your account"); } return 1; } |
CMD:deposit(playerid,params[])
{
new string[92];
new type;
if(sscanf(params, "d", type)) return SendClientMessage(playerid, -1, "[USAGE]: /deposit [amount]");
if(type <= 0) return SendClientMessage(playerid, -1, "ERROR: Amount must be greater than zero.");
if(GetPlayerMoney(playerid) >= type)
{
GivePlayerMoney(playerid, -type);
BankInfo[playerid][pBankAccount] += type;
format(string, sizeof(string), "INFO: You have successfully deposited $%d to your bank account.", type);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You do not have that much amount in your hand");
return 1;
}
CMD:withdraw(playerid,params[])
{
new string[92];
new type;
if(sscanf(params, "d", type)) return SendClientMessage(playerid, -1, "[USAGE]: /withdraw [amount]");
if(type <= 0) return SendClientMessage(playerid, -1, "ERROR: Amount must be greater than zero.");
if(BankInfo[playerid][pBankAccount] >= type)
{
BankInfo[playerid][pBankAccount] -= type;
GivePlayerMoney(playerid, type);
format(string, sizeof(string), "INFO: You have successfully withdrawn $%d from your bank account.", type);
SendClientMessage(playerid, 0xFFFFFFFF, string);
}
else SendClientMessage(playerid, 0xFFFFFFFF, "SERVER: You do not have that much amount in your account");
return 1;
}