CMD : deposit
#1

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;
} 
Reply
#2

Nvm, Fixed.
Reply
#3

Being in bank (location) only doesn't matter, you should be INSIDE that checkpoint.

And what's that?
pawn Код:
if(IsPlayerInDynamicCP(playerid, Bank1 || IsPlayerInDynamicCP(playerid, Bank2)))
the correct check would be:
pawn Код:
if(IsPlayerInDynamicCP(playerid, Bank1) || IsPlayerInDynamicCP(playerid, Bank2))
but if you add the bank2 check in the top along with bank1 so it will return the error, you won't need to check for that anymore.
Reply
#4

Tell how you find out the problem for other players.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)