Problems with gates
#8

first here is what I do... It can be done in other ways also.

first, creating the variable for the gate...

Код:
new gate1;
new gate2;
The creating the object(gate)

Код:
public OnFilterScriptInit()/public OnGameModeInit()
{
	gate1 = CreateObject(2927,215.92999390,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorr) (D)
	gate2 = CreateObject(2929,211.85000732,1875.50000000,13.89999962,0.00000000,0.00000000,0.00000000); //object(a51_blastdoorl) (D)
}
Then the command to open the gate(please note that when you do it this way you must use different commands for every gate)

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hopen", cmdtext, true, 6) == 0) // The /open command
	{
		if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470))
		{
			MoveObject(gate1, 219.92999390,1875.50000000,13.89999962, 1);
			MoveObject(gate2, 207.85000732,1875.50000000,13.89999962, 1);
		}
		return 1;
	}
}
Then, if you want, a command to close the gate, or you can make a timer to close it.

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if (strcmp("/hclose", cmdtext, true, 7) == 0)// The /close command
	{
		if(IsPlayerInRangeOfPoint(playerid, 5, 213.8570,1875.4865,13.1470))
		{
			MoveObject(gate1, 215.92999390,1875.50000000,13.89999962, 1);// Moving the gate
			MoveObject(gate2, 211.85000732,1875.50000000,13.89999962, 1);// Moving the gate
		}
		return 1;
	}
}
Reply


Messages In This Thread
Problems with gates - by Luke_James - 28.08.2012, 12:44
Re: Problems with gates - by RicaNiel - 28.08.2012, 12:50
Re: Problems with gates - by Luke_James - 28.08.2012, 12:52
Re: Problems with gates - by _Khaled_ - 28.08.2012, 14:10
Re: Problems with gates - by Luke_James - 28.08.2012, 14:48
Re: Problems with gates - by Luke_James - 28.08.2012, 15:18
Re: Problems with gates - by avivelkayam - 28.08.2012, 16:31
Re: Problems with gates - by Hyperfire - 28.08.2012, 20:52
Re: Problems with gates - by RedFusion - 28.08.2012, 20:54
Re: Problems with gates - by mamorunl - 28.08.2012, 21:05

Forum Jump:


Users browsing this thread: 1 Guest(s)