Help with open/close gate with 'Y'
#1

I made 2 gate to open with 'Y' or 'KEY_YES'
I add this under OnPlayerKeyStateChange
Код:
	if(newkeys == KEY_YES)
	{
   		if(IsPlayerInRangeOfPoint(playerid, 4.0, 1583.25732, -1638.13708, 13.66108))
    	{
			if(PDvratao == 0)
			{
				if(PlayerInfo[playerid][pLider]==1||PlayerInfo[playerid][pClen]==1)
				{
					PDvratao = 1;
					MoveObject(PDporta2, 1583.25732, -1638.13708, 5.66108, 3.0);
					SendClientMessage(playerid,BELA,"{00FFFF}(DWIG){FF5300} You open the gate!");
				}
			}
   			if(PDvratao == 1)
			{
				if(PlayerInfo[playerid][pLider]==1||PlayerInfo[playerid][pClen]==1)
				{
					PDvratao = 0;
					MoveObject(PDporta2, 1583.25732, -1638.13708, 13.66108, 3.0);
					SendClientMessage(playerid,BELA,"{00FFFF}(DWIG){FF5300} You close the gate!");
				}
			}
		}
		if(IsPlayerInRangeOfPoint(playerid, 8.0, 1544.67786, -1630.77185, 12.88390))
    	{
			if(PDrampao == 0)
			{
				if(PlayerInfo[playerid][pLider]==1||PlayerInfo[playerid][pClen]==1)
				{
					PDrampao = 1;
					MoveObject(PDporta3,1544.69995117,-1630.80004883,13.10000038,0.5,0.00000000,357.74978638,270.25003052);
					SendClientMessage(playerid,BELA,"{00FFFF}(DWIG){FF5300} You open the gate!");
				}
			}
   			if(PDrampao == 1)
			{
				if(PlayerInfo[playerid][pLider]==1||PlayerInfo[playerid][pClen]==1)
				{
					PDrampao = 0;
					MoveObject(PDporta3,1544.69995117,-1630.80004883,13.10000038,0.5,0.00000000,269.74978638,270.25000000);
					SendClientMessage(playerid,BELA,"{00FFFF}(DWIG){FF5300} You close the gate!");
				}
			}
		}
	}
But this doesn't work correct ingame. Here some images:
http://i.imgur.com/EfbWxAv.png
http://i.imgur.com/PisZ2Oe.png
Reply


Messages In This Thread
Help with open/close gate with 'Y' - by ilepopivanov - 26.11.2014, 11:59
Re: Help with open/close gate with 'Y' - by Matess - 26.11.2014, 12:48

Forum Jump:


Users browsing this thread: 1 Guest(s)