Gates open with key
#1

hi,
i got now this but only the first one works the door but gates dont work now..

Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    new string[128];
	new sendername[MAX_PLAYER_NAME];
	new pveh = GetVehicleModel(GetPlayerVehicleID(playerid));
	new newcar = GetPlayerVehicleID(playerid);
	new gun1 = GetPlayerWeapon(playerid);
	new gunname1[24];
	GetWeaponName(gun1,gunname1,sizeof(gunname1));
	if(IsKeyJustDown(KEY_HANDBRAKE,newkeys,oldkeys))
	{
	    StopLoopingAnim(playerid);
        TextDrawHideForPlayer(playerid,txtAnimHelper);
        animation[playerid] = 0;
    }
    else if ((newkeys & KEY_SECONDARY_ATTACK))
    {
    	if(IsACop(playerid) || PlayerInfo[playerid][pAdmin] >= 6)
	    {
	        if(IsPlayerInRangeOfPoint(playerid, 1,245.22988891602, 72.328125, 1004.1201782227) || IsPlayerInRangeOfPoint(playerid,1, 245.2560,74.1671,1003.6406))
			{
			      PlayerPlaySound(playerid, 1084, 0.0, 0.0, 0.0);
		      		MoveObject(pddoor11, 242.92161560059, 72.452613830566, 1002.640625, 3.0);
		      		MoveObject(pddoor12, 249.89422607422, 72.452613830566, 1002.640625, 3.0);
		      		SendClientMessage(playerid, COLOR_BLUE,"LSPD door is opened and will close in 2 seconds!");
		      		GetPlayerName(playerid, sendername, sizeof(sendername));
		      		format(string, sizeof(string), "* %s opens the LSPD door.", sendername);
		      		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		      		SetTimer("pddoorclose", 2000, 0);
		      	}

   else if ((newkeys & KEY_CROUCH))
		      	
		   	if (IsPlayerInRangeOfPoint(playerid, 15,1589.053344,-1638.123168,14.122960))
			{
				if(lspdg == 1) { SendClientMessage(playerid, COLOR_GREY, "** Gate is Already Opened"); return 1; }
		  		MoveDynamicObject(pdgate1,1599.053344,-1638.123168,14.122960, 0.8);
		      	SetTimer("GateClose", 12000, 0);
		     	SendClientMessage(playerid, COLOR_BLUE,"A garage is opened and will close in 7 seconds.");
		   		format(string, sizeof(string), "* %s takes his/her remote and opens a garage.", sendername);
		   		ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
		   		PlayerPlaySound(playerid, 1153, 1589.053344,-1638.123168,14.122960);
		     	lspdg = 1;

                    }
.............
.............
.............
how to let the last one works ...
last one are much more gates but i only putted one in.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)