Atm question.
#1

Hello i have an atm code that i want to edit a little bit.

The code is /atmwithdraw that if the player is near an atm machine he can simply /atmwithdraw but i made an atm card that he can buy from the 24/7 and if he got it he can /atmwithdraw but i want to set that every time he buys that card the player gets a code that if he got the atm car and he /atmwithdraw he needs to set a code like

/atmwithdraw [Code] [Amount]

Any ideas?

Код:
	if(strcmp(cmd, "/atmwithdraw", true) == 0)
		{
		    if(IsPlayerConnected(playerid))
		    {
		        if(!IsPlayerInRangeOfPoint(playerid, 3, -32.276363,-57.995586,1003.139953) && !IsPlayerInRangeOfPoint(playerid, 3, 374.718902,167.128982,1007.987304) && !IsPlayerInRangeOfPoint(playerid, 3, 1748.79980469,-1863.50000000,13.19999981))
		        {
		            SendClientMessage(playerid, COLOR_GREY, "   You are not at an ATM!");
		            return 1;
		        }
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /atmwithdraw [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: /atmwithdraw [amount]");
					format(string, sizeof(string), "  You Have $%d in your account.", PlayerInfo[playerid][pAccount]);
					SendClientMessage(playerid, COLOR_GRAD3, string);
					return 1;
				}
				if (cashdeposit > PlayerInfo[playerid][pAccount] || cashdeposit < 1)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   You dont have that much !");
					return 1;
				}


				if (cashdeposit > 5000)
				{
					SendClientMessage(playerid, COLOR_GRAD2, "   You can only withdraw up to $5000!");
					return 1;
				}

			    ConsumingMoney[playerid] = 1;
				SafeGivePlayerMoney(playerid,cashdeposit);
				PlayerInfo[playerid][pAccount]=PlayerInfo[playerid][pAccount]-cashdeposit;
				format(string, sizeof(string), "  You Have Withdrawn $%d from your account Total: $%d ", cashdeposit,PlayerInfo[playerid][pAccount]);
				SendClientMessage(playerid, COLOR_YELLOW, string);
				PlayerInfo[playerid][pJobTimer] = 12;
	            GetPlayerName(playerid, giveplayer, sizeof(giveplayer));
	 			format(string, sizeof(string), "  ID(%d) -%s has withdrawn %d from their bank.", playerid,giveplayer,cashdeposit);
				ABroadCast(COLOR_YELLOW,string, 5);
                
				new y, m, d;
				new h,mi,s;
				getdate(y,m,d);
				gettime(h,mi,s);
				format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /atmwithdraw ($%d)",d,m,y,h,mi,s,sendername, cashdeposit);
				PayLog(string);
				return 1;
			}
			return 1;
		}
Reply
#2

What variable turns to 1 when the buy's the card? Give me the variable and ill update your command!
Reply
#3

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
What variable turns to 1 when the buy's the card? Give me the variable and ill update your command!
Код:
				else if (listitem == 2 && GetPlayerMoney(playerid) > 10)
				{
				    if(PlayerInfo[playerid][pTraderPerk] > 0)
				    {
						new skill = 10 / 100;
						new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
						new payout = 10 - price;
						SafeGivePlayerMoney(playerid,- payout);
						SBizzInfo[9][sbTill] += payout;
						ExtortionSBiz(9, payout);
						GameTextForPlayer(playerid, "~r~-$10", 5000, 1);
					}
					else
					{
					    SafeGivePlayerMoney(playerid,- 10);
						SBizzInfo[9][sbTill] += 10;
						ExtortionSBiz(9, 10);
						format(string, sizeof(string), "~r~-$%d", 100);
						GameTextForPlayer(playerid, string, 5000, 1);
					}
					PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
	                PlayerInfo[playerid][pPhoneCard] = 1;
					format(string, sizeof(string), "   Phone Card Purchased you can Use the Pay Phone now !");
					SendClientMessage(playerid, COLOR_GRAD4, string);
					SendClientMessage(playerid, COLOR_GREEN, "HINT: Type /number at the payphone..");
					return 1;
				}
Reply
#4

Not this! When the guy buy's the Card at a 24/7 . What do you check as true? Is that a variable?

OR

You want me to create you one like that , isnt it? Sorry for making it confusing for you!
Reply
#5

Ok i dont understand u so if u can create me an atm card like that maybe i'll understand lol
Reply
#6

Give me your 24/7 buy command? or the dialog response if it contain's a dialog with listed items!
Reply
#7

Quote:
Originally Posted by Ballu Miaa
Посмотреть сообщение
Give me your 24/7 buy command? or the dialog response if it contain's a dialog with listed items!
Код:
	if(strcmp(cmd, "/buy", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (IsPlayerInRangeOfPoint(playerid, 50,-30.875, -88.9609, 1004.53) || IsPlayerInRangeOfPoint(playerid, 50,-22.2385, -55.4614, 1003.0000) || IsPlayerInRangeOfPoint(playerid, 50,-32.6100, -28.9878, 1003.0000) || IsPlayerInRangeOfPoint(playerid, 50,-18.4414, -137.2982, 1003.1798) || IsPlayerInRangeOfPoint(playerid, 50,-21.9642, -184.5048, 1003.0000))//centerpoint 24-7
			{
				if(BizzInfo[7][bProducts] == 0 || BizzInfo[8][bProducts] == 0 || BizzInfo[9][bProducts] == 0 || BizzInfo[10][bProducts] == 0)
				{
					GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
					return 1;
				}
				new Buyitems[] = "1\tCellphone ($150)\n2\tScratch Card ($500)\n3\tPhone Card ($10)\n4\tDice ($10)\n5\tGas Can ($20)\n6\tCondom ($1)\n7\tCamera ($50)\n8\tMask ($500)\n9\tWatch ($100)\n10\tFishing Tools ($150$)\n11\tRope ($10)\n12\tSpray Can ($50)\n13\tLighter ($5)\n14\tCigarretes ($30\n15\tCD Player ($250)\n16\tVehicle GPS Add-On ($1500)\n17\tSpeed-o-Metter ($500)";
				ShowPlayerDialog(playerid,69,DIALOG_STYLE_LIST,"24-7 Market",Buyitems,"Select","Cancel");
			}
			else if (IsPlayerInRangeOfPoint(playerid, 50, -106.0233,-11.1038,1000.7188))
			{
			    new Buysexitems[] = "1\tPurple Dildo ($50)\n2\tBig white Vibrator ($35)\n3\tSmall White Vibrator($10)\n4\tSilver Vibrator ($15)\n5\tCondom ($1)";
				ShowPlayerDialog(playerid,88,DIALOG_STYLE_LIST,"Sex Shop",Buysexitems,"Select","Cancel");
			}
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /buy",d,m,y,h,mi,s,sendername);
			CommandLog(string);
		}
		return 1;
	}
Reply
#8

Quote:
Originally Posted by viddo
Посмотреть сообщение
Код:
	if(strcmp(cmd, "/buy", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			if (IsPlayerInRangeOfPoint(playerid, 50,-30.875, -88.9609, 1004.53) || IsPlayerInRangeOfPoint(playerid, 50,-22.2385, -55.4614, 1003.0000) || IsPlayerInRangeOfPoint(playerid, 50,-32.6100, -28.9878, 1003.0000) || IsPlayerInRangeOfPoint(playerid, 50,-18.4414, -137.2982, 1003.1798) || IsPlayerInRangeOfPoint(playerid, 50,-21.9642, -184.5048, 1003.0000))//centerpoint 24-7
			{
				if(BizzInfo[7][bProducts] == 0 || BizzInfo[8][bProducts] == 0 || BizzInfo[9][bProducts] == 0 || BizzInfo[10][bProducts] == 0)
				{
					GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
					return 1;
				}
				new Buyitems[] = "1\tCellphone ($150)\n2\tScratch Card ($500)\n3\tPhone Card ($10)\n4\tDice ($10)\n5\tGas Can ($20)\n6\tCondom ($1)\n7\tCamera ($50)\n8\tMask ($500)\n9\tWatch ($100)\n10\tFishing Tools ($150$)\n11\tRope ($10)\n12\tSpray Can ($50)\n13\tLighter ($5)\n14\tCigarretes ($30\n15\tCD Player ($250)\n16\tVehicle GPS Add-On ($1500)\n17\tSpeed-o-Metter ($500)";
				ShowPlayerDialog(playerid,69,DIALOG_STYLE_LIST,"24-7 Market",Buyitems,"Select","Cancel");
			}
			else if (IsPlayerInRangeOfPoint(playerid, 50, -106.0233,-11.1038,1000.7188))
			{
			    new Buysexitems[] = "1\tPurple Dildo ($50)\n2\tBig white Vibrator ($35)\n3\tSmall White Vibrator($10)\n4\tSilver Vibrator ($15)\n5\tCondom ($1)";
				ShowPlayerDialog(playerid,88,DIALOG_STYLE_LIST,"Sex Shop",Buysexitems,"Select","Cancel");
			}
			new y, m, d;
			new h,mi,s;
			getdate(y,m,d);
			gettime(h,mi,s);
			format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /buy",d,m,y,h,mi,s,sendername);
			CommandLog(string);
		}
		return 1;
	}
Where have you added Option to buy a Credit card or some thing which you want to be added in that Command? Where do he buy it from?
Reply
#9

He buys it from 24/7 lets say its the phone card for now.
Reply
#10

Give me OnDialogResponse of dialogid 69 please. Ill make this CMD according to your own function's used in your gm!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)