Auto gate close.
#1

Okay i;ve look in the Search, i've looked at the auto gate topic on wiki.. and yet it still does not make sence to me, so can sum one please help me..

here my code to open the gate.. i need sum one to tell me how to set it up so after 5 seconds it will auto close....

Код:
 if (strcmp("/hqopen", cmdtext, true, 10) == 0) // OPENS GATE
  		{
  		if (PlayerToPoint(20.00, playerid, 785.547, -1152.5, 25.3229))
  		{
  		MoveObject(gate1,785.547, -1152.5, 31.1229, 2.0);
  		SendClientMessage(playerid, 0xFFFFFFAA, "Tea House Gate Is Now Opening");
	}
		else
	{
  		SendClientMessage(playerid, 0xf01818FF, "Sorry, To Far Away To Open Tea House Gate");
	}
  	return 1;
	}
Reply
#2

All about the timer<

Код:
//on top of your script
forward CloseGate();

//on OnPlayerCommandText
if (strcmp("/hqopen", cmdtext, true, 10) == 0) // OPENS GATE
{
  	if (PlayerToPoint(20.00, playerid, 785.547, -1152.5, 25.3229))
  	{
  		MoveObject(gate1,785.547, -1152.5, 31.1229, 2.0);
  		SendClientMessage(playerid, 0xFFFFFFAA, "Tea House Gate Is Now Opening");
         SetTimer("CloseGate", 5000, false);

	}
	else
	{
  		SendClientMessage(playerid, 0xf01818FF, "Sorry, To Far Away To Open Tea House Gate");
	}
  	return 1;
}

// At a place in your script..
public CloseGate()
{
	MoveObject(gate1, X,Y,Z, 2.0); // gate close pos
	return 1;
}
Reply
#3

what include?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)