Jump to content
  • 0

Problema Bank /deposit


AlexVs

Question

Am o problema intru in bank unde folosesc comanda asta

[pawn] if(strcmp(cmd, "/bank", true) == 0 || strcmp(cmd, "/deposit", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

        if(PlayerInfo[playerid][pLocal] != 103)

        {

            SendClientMessage(playerid, COLOR_GREY, "  You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bank [amount]");

format(string, sizeof(string), "  You Have $%d in your account.", PlayerInfo[playerid][pAccount]);

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /bank [amount]");

format(string, sizeof(string), "  You Have $%d in your account.", PlayerInfo[playerid][pAccount]);

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "  You dont have that much");

return 1;

}

GivePlayerMoney(playerid,-cashdeposit);

new curfunds = PlayerInfo[playerid][pAccount];

PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount];

SendClientMessage(playerid, COLOR_WHITE, "|___ BANK STATMENT ___|");

format(string, sizeof(string), "  Old Balance: $%d", curfunds);

SendClientMessage(playerid, COLOR_GRAD2, string);

format(string, sizeof(string), "  Deposit: $%d",cashdeposit);

SendClientMessage(playerid, COLOR_GRAD4, string);

SendClientMessage(playerid, COLOR_GRAD6, "|-----------------------------------------|");

format(string, sizeof(string), "  New Balance: $%d", PlayerInfo[playerid][pAccount]);

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

return 1;

}[/pawn]

Si apar urmat imagini

a0736d60b090456367292e4aaf69d671.png

[img width=500 height=375]http://gf-image.com/upload/9c0ca1cda3bce0d219debd9caf775e59.png

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.