13.06.2015, 13:40
What's wrong with it. It still shows me this msg even when i am in bank1. "you must be inside of a bank to use this command". I can't get what is wrong anyone help? also tell me whats the problem. thanks
PHP код:
CMD:deposit(playerid, params[])
{
new amount;
if(!IsPlayerInDynamicCP(playerid, Bank1)) return SendClientMessage(playerid, RED, "You must be inside of a bank to use this command.");
if(sscanf(params, "i", amount)) return SendClientMessage(playerid, COLOR_RED, "/deposit [amount]");
if(amount > GetPlayerMoney(playerid)) return SendClientMessage(playerid,COLOR_RED,"You dont have enough money.");
if(amount <= 0) return SendClientMessage(playerid,COLOR_RED,"You have to deposit atleast $1 into the bank!");
if(IsPlayerInDynamicCP(playerid, Bank1 || IsPlayerInDynamicCP(playerid, Bank2)))
GivePlayerCash(playerid,-amount);
pInfo[playerid][pBankMoney] += amount;
new string[128];
format(string,sizeof(string),"You have deposited: $%d Total Money: $%d",amount, pInfo[playerid][pBankMoney]);
SendClientMessage(playerid,GREEN,string);
return 1;
}