Moveable objects
#2

My example:

Код:
new gDoorLSPD[2];
new gDoorZone[2]; //for LSPD and SFPD
new gDoorStatus[2]; //for LSPD and SFPD

gDoorLSPD[0] = CreateDynamicObject(1495,244.987503, 72.491752, 1002.589904, 0.000000, 0.000000, 0.000000, 30);
	gDoorLSPD[1] = CreateDynamicObject(1495,247.984191, 72.491752, 1002.589904, 0.000000, 0.000000, 180.0, 30);

forward MoveLSPDDoors();
public MoveLSPDDoors()
{
	if(!gDoorStatus[0]) return 1;
	
	MoveDynamicObject(gDoorLSPD[0], 244.987503, 72.491752, 1002.589904, 0.3);
	MoveDynamicObject(gDoorLSPD[1], 247.987503, 72.491752, 1002.589904, 0.3);
	gDoorStatus[0] = 0;
	
	return 1;
}

if(!IsPlayerInAnyVehicle(playerid) && (newkeys & KEY_SECONDARY_ATTACK))
	{
		if(IsPlayerInDynamicArea(playerid, gDoorZone[0]))
		{
			if(!CopKeys[playerid] && !IsPlayerCop(playerid)) return SendClientMessage(playerid, COLOR_GREY, " You no have a keys");
		
			if(IsDynamicObjectMoving(gDoorLSPD[0]) || IsDynamicObjectMoving(gDoorLSPD[1])) return SendClientMessage(playerid, COLOR_GREY, " Doors moving!");
		
			if(!gDoorStatus[0])
			{
				MoveDynamicObject(gDoorLSPD[0], 243.987503, 72.491752, 1002.589904, 0.3);
				MoveDynamicObject(gDoorLSPD[1], 248.987503, 72.491752, 1002.589904, 0.3);
				gDoorStatus[0] = 1;
				SetTimer("MoveLSPDDoors", 10000, 0);
			}
			else
			{
				MoveDynamicObject(gDoorLSPD[0], 244.987503, 72.491752, 1002.589904, 0.3);
				MoveDynamicObject(gDoorLSPD[1], 247.987503, 72.491752, 1002.589904, 0.3);
				gDoorStatus[0] = 0;
			}
		}
	}
Reply


Messages In This Thread
Moveable objects - by CSLangdale - 24.04.2016, 21:51
Re: Moveable objects - by povargek - 24.04.2016, 22:04
Re: Moveable objects - by Saliim - 24.04.2016, 22:07
Re: Moveable objects - by povargek - 24.04.2016, 22:08
Re: Moveable objects - by CSLangdale - 24.04.2016, 22:20

Forum Jump:


Users browsing this thread: 1 Guest(s)