Questions with gate
#1

OK, so i made command /mgate what opens the gate of bike parking. And it cost 2000$ to open the gate, closing cost nothing. But when i try to close the gate with less than 2000$, it will say that i dont have enough money...So the problem is: I want that "You dont have enough money" say ONLY for OPENING the gate.

Код:
	if(strcmp(cmdtext,"/mgate",true ) == 0 )
	
	if(GetPlayerMoney(playerid) < 2000)
	{
		SendClientMessage(playerid, red, "You dont have enough money");
		return 1;
	}
	
		else

	{
	  if(PlayerToPoint(10.0,playerid,-505.2811,2592.9241,53.4345))
		{
			if(mgate == 1)
			{
				MoveObject(gate, -504.925720, 2590.153564, 53.475311, 2.0);
				MoveObject(gate2, -504.894165, 2595.635498, 53.470360, 2.0);
				SendClientMessage(playerid, aqua, "Gate of bike parking is now closed");
				mgate = 0;
			}
			else
			{
			MoveObject(gate,-504.925720, 2584.749756, 53.475311, 2.00 );
			MoveObject(gate2,-504.894165, 2601.114014, 53.470360, 2.00);
			GivePlayerMoney(playerid, -2000);
			SendClientMessage(playerid, aqua, "Gate of bike parking is now opened, it cost you 2000$");
			mgate = 1;
			}
			return 1;
			
		}
		else
		{
			SendClientMessage(playerid, 0x804040FF, "You're not near the gate!");
			return 1;
		}
And another question:
How can i add timer to it? Like: if the gate is opened, then it will close after 1 min ?
Reply


Messages In This Thread
Questions with gate - by tturvas - 01.08.2009, 04:27
Re: Questions with gate - by Yuryfury - 01.08.2009, 04:38
Re: Questions with gate - by tturvas - 01.08.2009, 04:59
Re: Questions with gate - by Yuryfury - 01.08.2009, 05:02
Re: Questions with gate - by tturvas - 01.08.2009, 05:11
Re: Questions with gate - by Abernethy - 01.08.2009, 05:14
Re: Questions with gate - by tturvas - 01.08.2009, 05:15
Re: Questions with gate - by Abernethy - 01.08.2009, 05:25
Re: Questions with gate - by tturvas - 01.08.2009, 11:41
Re: Questions with gate - by Serediucr - 01.08.2009, 12:07

Forum Jump:


Users browsing this thread: 1 Guest(s)