gate problem
#4

antonio is right.
but , you can also make it with 1 command ....using switch.
like this
Create a variable
for explame :
Код:
new gate1Status = 0;
and of course a variable for the gate creation.
Код:
new gate1;
Before we continue let me explain you something . in case the gate1Status is 0 , the gate is closed. in case its 1 , the gate is opend.
ok now under public OnFilterScriptInit()
create the gate.
Код:
gate1 = CreateObject(980,923.155,-1225.358,18.3,0.0,0.0,90.000);
Okey now for the command :

Код:
if(strcmp(cmdtext,"/red",true) == 0)//checks if the cmdtext is euquals to /red.(not case sesitive)
{
	switch(gate1Status)//the switch. checks the gate1Status val(integer). case its 0 it will do X case its 1 it will do X.
	{
	    case 0://In case the gate is closed. that will open the gate.
	    {
            MoveObject(gate1, 923.155,-1225.358,7.3,3.0);//move the object to another place with 3.0 speed.
 			SendClientMessage(playerid,COLOR_LIGHTCYAN,"Red Blood'z Gate Is Open.Please Use /redclose to close gate");
	    }
	    
	    case 1://In case the gate is open . that will close the gate .
	    {
            MoveObject(gate1, 923.155,-1225.358,18.3,3.0);//move the object back to the start where its created with 3.0 speed.
            SendClientMessage(playerid,COLOR_LIGHTCYAN,"Red Blood'z Gate is Closed.Thanks");
	    }
	}
	return 1;//return 1 .... so you wont get any errors or stupid bugs
}
Reply


Messages In This Thread
gate problem - by Venice - 20.03.2011, 01:07
Re: gate problem - by antonio112 - 20.03.2011, 02:29
Re: gate problem - by Venice - 20.03.2011, 06:06
Re: gate problem - by bijoyekuza - 20.03.2011, 06:08
Re: gate problem - by antonio112 - 20.03.2011, 06:09
Re: gate problem - by bijoyekuza - 20.03.2011, 06:11
Re: gate problem - by Venice - 20.03.2011, 06:30

Forum Jump:


Users browsing this thread: 1 Guest(s)