Lock.
#5

It locks but I can't unlock it. When you do /yaklock, it locks correctly but when I do /yaklock again it does nothing.
The command:
Код:
if(!strcmp(cmdtext,"/yaklock",true))
{
if(PlayerToPoint(1.0,playerid,2324.0361,-1143.1575,1050.4922))
		      {
	if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2 )
		    {
		    GetPlayerName(playerid, sendername, sizeof(sendername));
			  format(string, sizeof(string), "* %s twists the key in the hole, locking the door.", sendername);
			  ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
   if(Locked)
   {
      Locked = false;
      //Unlocked
   }
   else
   {
      Locked = true;
      //Locked
	    }
			  }
			}

		return 1;
	}
The teleport part:
Код:
else if (PlayerToPointStripped(1.0, playerid,1252.2933,-980.0336,37.5556, cx,cy,cz))
	{     		//Yakuza
	if(Locked)
	{
	GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
	}
	else
	{
	SetPlayerPos(playerid,2324.0361,-1143.1575,1050.4922);
		GameTextForPlayer(playerid, "~w~Yakuza HQ", 5000, 3);
		SetPlayerInterior(playerid,12);
		PlayerInfo[playerid][pInt] = 12;
	}
	}
Also, if I added if(Locked) to all the doors, wouldn't /yaklock lock all of them rather than just one?
Reply


Messages In This Thread
Lock. - by -eXo - 27.05.2009, 20:16
Re: Lock. - by -eXo - 27.05.2009, 23:55
Re: Lock. - by Backwardsman97 - 28.05.2009, 00:40
Re: Lock. - by -eXo - 28.05.2009, 01:07
Re: Lock. - by -eXo - 28.05.2009, 17:22
Re: Lock. - by -eXo - 28.05.2009, 21:07

Forum Jump:


Users browsing this thread: 1 Guest(s)