Jump to content

Question

Posted

Salut intru in banca dau /withdraw /deposit etc si imi spune ca nu sunt in banca . O sa va arat comanda si coordonatele sa imi spuneti ce am gresit.

[pawn]if(strcmp(cmd, "/withdraw", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(PlayerToPoint(6.0, playerid, 1504.2522,-1038.8168,601.5460) || IsAtATMSystem(playerid))

      {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much !");

return 1;

}

  //ConsumingMoney[playerid] = 1;

SafeGivePlayerMoney(playerid,cashdeposit);

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

format(string, sizeof(string), "[server]: You Have Withdrawn %s from your account Total: %s", DecimalPoint(cashdeposit),DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

    return 1;

}

}

return 1;

}

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

{

    if(IsPlayerConnected(playerid))

    {

        if(!PlayerToPoint(6.0, playerid, 1500.3766,-1038.3237,601.5460) && !IsAtATMSystem(playerid))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

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

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much");

return 1;

}

SafeGivePlayerMoney(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: %s", DecimalPoint(curfunds));

SendClientMessage(playerid, COLOR_GRAD2, string);

format(string, sizeof(string), "Deposit: %s",DecimalPoint(cashdeposit));

SendClientMessage(playerid, COLOR_GRAD4, string);

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

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

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

return 1;

}

if(strcmp(cmd, "/balance", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(PlayerToPoint(6.0, playerid, 1496.6987,-1038.3569,601.5460) || IsAtATMSystem(playerid))

        {

format(string, sizeof(string), "[server]: You Have %s in your account.",DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

}

}

return 1;

}[/pawn]

1 answer to this question

Recommended Posts

Posted

[pawn]if(strcmp(cmd, "/withdraw", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

    if(!PlayerToPoint(6.0, playerid, 1504.2522,-1038.8168,601.5460) || IsAtATMSystem(playerid))

      {

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /withdraw [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much !");

return 1;

}

  //ConsumingMoney[playerid] = 1;

SafeGivePlayerMoney(playerid,cashdeposit);

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

format(string, sizeof(string), "[server]: You Have Withdrawn %s from your account Total: %s", DecimalPoint(cashdeposit),DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

return 1;

}

else

{

SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

    return 1;

}

}

return 1;

}

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

{

    if(IsPlayerConnected(playerid))

    {

        if(!PlayerToPoint(6.0, playerid, 1500.3766,-1038.3237,601.5460 || IsAtATMSystem(playerid))

        {

            SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

        }

tmp = strtok(cmdtext, idx);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

new cashdeposit = strval(tmp);

if(!strlen(tmp))

{

SendClientMessage(playerid, COLOR_GRAD2, "{00A1FF}USAGE{FFFFFF}: /bank [amount]");

format(string, sizeof(string), "[server]: You Have %s in your account.", DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_GRAD3, string);

return 1;

}

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

{

SendClientMessage(playerid, COLOR_GRAD2, "[Eroare]: You dont have that much");

return 1;

}

SafeGivePlayerMoney(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: %s", DecimalPoint(curfunds));

SendClientMessage(playerid, COLOR_GRAD2, string);

format(string, sizeof(string), "Deposit: %s",DecimalPoint(cashdeposit));

SendClientMessage(playerid, COLOR_GRAD4, string);

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

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

SendClientMessage(playerid, COLOR_WHITE, string);

return 1;

}

return 1;

}

if(strcmp(cmd, "/balance", true) == 0)

{

    if(IsPlayerConnected(playerid))

    {

if(!PlayerToPoint(6.0, playerid, 1496.6987,-1038.3569,601.5460) || IsAtATMSystem(playerid))

        {

format(string, sizeof(string), "[server]: You Have %s in your account.",DecimalPoint(PlayerInfo[playerid][pAccount]));

SendClientMessage(playerid, COLOR_YELLOW, string);

}

else

{

    SendClientMessage(playerid, COLOR_GREY, "[Eroare]: You are not at the Bank !");

            return 1;

}

}

return 1;

}[/pawn]

Poftim acum trebuie sa mearga!

[MAP]Noul Cartier - http://www.sa-mp.ro/forum/index.php?topic=31520.0

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.