Jump to content
  • 0

Question

Posted

Salut all , am vrut sa fac si eu la comanda /withdraw , cei care nu au 4 rp-uri sa nu poata sa dea , si tot nu merge

CMD:withdraw(playerid, params[])
{
            new string[256];

	        if(PlayerInfo[playerid][pExp] == 4) return SendClientMessage(playerid, COLOR_GRAD1, "4 Respect Points pentru a folosi comanda !");
	        if(PlayerInfo[playerid][pLocal] == 103)
            {
	        if(sscanf(params, "i", withdraw))
            {
	             SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /withdraw [amount]");
	             format(string, sizeof(string), "You Have %s in your account.", FormatMoney(PlayerInfo[playerid][pAccount]));
                 SendClientMessage(playerid, COLOR_GRAD3, string);
                 return 1;
	        }
	        if (withdraw > PlayerInfo[playerid][pAccount] || withdraw < 1)
			{
				SendClientMessage(playerid, COLOR_GRAD1, "You dont have that much.");
				return 1;
			}
			ConsumingMoney[playerid] = 1;
			PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + withdraw;
			PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-withdraw;
			format(string, sizeof(string), "You Have Withdrawn %s from your account Total: %s ", FormatMoney(withdraw),FormatMoney(PlayerInfo[playerid][pAccount]));
			SendClientMessage(playerid, COLOR_YELLOW, string);
			}
		    else if(PlayerToPoint(1.5, playerid, -1973.2712,117.3730,27.6875))
			{
                    if(sscanf(params, "i", withdraw))
                    {
	                     SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /withdraw [amount]");
	                     format(string, sizeof(string), "You Have %s in your account.", FormatMoney(PlayerInfo[playerid][pAccount]));
                         SendClientMessage(playerid, COLOR_GRAD3, string);
                         return 1;
	                }
					if (withdraw > PlayerInfo[playerid][pAccount] || withdraw < 1)
					{
						SendClientMessage(playerid, COLOR_GRAD1, "You dont have that much !");
						return 1;
					}
				    ConsumingMoney[playerid] = 1;
					PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + withdraw;
					PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-withdraw;
					format(string, sizeof(string), "You Have Withdrawn %s from your account Total: %s ", FormatMoney(withdraw),FormatMoney(PlayerInfo[playerid][pAccount]));
					SendClientMessage(playerid, COLOR_YELLOW, string);
			}
			else
			{
                SendClientMessage(playerid, COLOR_GRAD1, "You are not at the Bank / ATM !");
  	        }
  	        return 1;
}

2 answers to this question

Recommended Posts

Posted

[pawn]CMD:withdraw(playerid, params[])

{

            new string[256];

            if(PlayerInfo[playerid][pExp] < 4) return SendClientMessage(playerid, COLOR_GRAD1, "4 Respect Points pentru a folosi comanda !");

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

            {

            if(sscanf(params, "i", withdraw))

            {

                SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /withdraw [amount]");

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

                SendClientMessage(playerid, COLOR_GRAD3, string);

                return 1;

            }

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

            {

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

                return 1;

            }

            ConsumingMoney[playerid] = 1;

            PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + withdraw;

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

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

            SendClientMessage(playerid, COLOR_YELLOW, string);

            }

            else if(PlayerToPoint(1.5, playerid, -1973.2712,117.3730,27.6875))

            {

                    if(sscanf(params, "i", withdraw))

                    {

                        SendClientMessage(playerid, COLOR_ORANGE, "{F97804}USAGE:{B4B5B7}{FFFFFF} /withdraw [amount]");

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

                        SendClientMessage(playerid, COLOR_GRAD3, string);

                        return 1;

                    }

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

                    {

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

                        return 1;

                    }

                    ConsumingMoney[playerid] = 1;

                    PlayerInfo[playerid][pCash] = PlayerInfo[playerid][pCash] + withdraw;

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

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

                    SendClientMessage(playerid, COLOR_YELLOW, string);

            }

            else

            {

                SendClientMessage(playerid, COLOR_GRAD1, "You are not at the Bank / ATM !");

          }

          return 1;

}

[/pawn]

Poftim

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.