SA-MP Forums Archive
CMD : deposit - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD : deposit (/showthread.php?tid=577691)



CMD : deposit - STONEGOLD - 13.06.2015

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(playeridparams[])
{
    new 
amount;
    if(!
IsPlayerInDynamicCP(playeridBank1)) return SendClientMessage(playeridRED"You must be inside of a bank to use this command.");
    if(
sscanf(params"i"amount)) return SendClientMessage(playeridCOLOR_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(playeridBank1 || IsPlayerInDynamicCP(playeridBank2)))
    
GivePlayerCash(playerid,-amount);
    
pInfo[playerid][pBankMoney] += amount;
    new 
string[128];
    
format(string,sizeof(string),"You have deposited: $%d Total Money: $%d",amountpInfo[playerid][pBankMoney]);
    
SendClientMessage(playerid,GREEN,string);
       return 
1;




Re: CMD : deposit - STONEGOLD - 13.06.2015

Nvm, Fixed.


Re: CMD : deposit - Konstantinos - 13.06.2015

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.


Re: CMD : deposit - GuyYahood1 - 13.06.2015

Tell how you find out the problem for other players.