[HELP]How can i make a 24-7 /buy showplayerdialog?
#1

Код:
if(strcmp(cmd, "/buy", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			if (!PlayerToPoint(100, playerid,-30.875, -88.9609, 1004.53))//centerpoint 24-7
			{
				SendClientMessage(playerid, COLOR_GRAD2, "  You are not in a 24-7 !");
				return 1;
			}
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /buy [item number]");
				SendClientMessage(playerid, COLOR_LIGHTBLUE, "|_______ 24-7 _______|");
				SendClientMessage(playerid, COLOR_GRAD1, "| 1: Cell Phone $150    2: Scratch Card $500");
				SendClientMessage(playerid, COLOR_GRAD1, "| 3: Phone Book $10   4: Dice $10");
				SendClientMessage(playerid, COLOR_GRAD2, "| 5: Gas can 20$       6: Condom $1");
				SendClientMessage(playerid, COLOR_GRAD3, "| 7: Camera $50       8: Mask 500$");
				SendClientMessage(playerid, COLOR_GRAD3, "| 9: Watch $100       10: Fish. tools 150$");
				SendClientMessage(playerid, COLOR_GRAD4, "| 11: Rope $10        12: Spray can 50$");
				SendClientMessage(playerid, COLOR_GRAD4, "| 13: Lighter 5$       14: Cigarettes 30$");
				return 1;
			}
			new item = strval(tmp);
			if(SBizzInfo[9][sbProducts] == 0)
			{
				GameTextForPlayer(playerid, "~r~Out Of Stock", 5000, 1);
				return 1;
			}
			if (item == 1 && GetPlayerMoney(playerid) > 149)
			{
			  if(PlayerInfo[playerid][pTraderPerk] > 0)
			  {
					new skill = 150 / 100;
					new price = (skill)*(PlayerInfo[playerid][pTraderPerk]);
					new payout = 150 - price;
			    format(string, sizeof(string), "~r~-$%d", payout);
					GameTextForPlayer(playerid, string, 5000, 1);
					SafeGivePlayerMoney(playerid,- payout);
					SBizzInfo[9][sbTill] += payout;
					ExtortionSBiz(9, payout);
			  }
			  else
			  {
			    format(string, sizeof(string), "~r~-$%d", 150);
					GameTextForPlayer(playerid, string, 5000, 1);
					SafeGivePlayerMoney(playerid,-150);
					SBizzInfo[9][sbTill] += 150;
					ExtortionSBiz(9, 150);
			  }
				PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
				new randphone = 100000 + random(899999);//minimum 1000 max 9999
				PlayerInfo[playerid][pPnumber] = randphone;
				format(string, sizeof(string), "  Mobile Phone Purchased your new Number is %d", randphone);
				SendClientMessage(playerid, COLOR_GRAD4, string);
				SendClientMessage(playerid, COLOR_GRAD5, "You can check this anytime by Typing /stats");
				SendClientMessage(playerid, COLOR_WHITE, "HINT: You can now type /help to see your cell phone commands.");
				return 1;
			}
Reply


Messages In This Thread
[HELP]How can i make a 24-7 /buy showplayerdialog? - by Lilcuete - 10.11.2009, 18:43
Re: [HELP]How can i make a 24-7 /buy showplayerdialog? - by Lilcuete - 10.11.2009, 18:44

Forum Jump:


Users browsing this thread: 1 Guest(s)