SA-MP Forums Archive
[help] Problem with gate command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [help] Problem with gate command (/showthread.php?tid=121275)



[help] Problem with gate command - dclaw - 16.01.2010

I got a problem with my gate command...

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
	if(strcmp("/opengate", cmdtext, true, 10) == 0)
	{
	MoveObject(gate,-293.828,1507.450,76.070,1.5000); // 1.5000 means how fast it has to open
	return 1;
}
	if (!strcmp("/home", cmdtext, true))
	{
  SetPlayerPos(playerid,-2461.3486,1399.6747,7.4893);
  return 1;
}
	return 1;
}
he is just moving, but not closing..
So if you can make it closing i will really thank you

Move object when he is closed:
Код:
MoveObject(Close, 302.154, 1507.450, 76.070, 4.0);



Re: [help] Problem with gate command - Retardedwolf - 16.01.2010

Add a timer under MoveObject.

pawn Код:
forward closegates();
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(strcmp("/opengate", cmdtext, true, 10) == 0)
    {
    MoveObject(gate,-293.828,1507.450,76.070,1.5000); // 1.5000 means how fast it has to open
    return 1;
}
  SetTimer("closegates",1000,false); //Change 1000 to how many ms you want after the gates is opened to close.
}
 
public message()
{
  MoveObject(Close, 302.154, 1507.450, 76.070, 4.0);
}



Re: [help] Problem with gate command - pagie1111 - 16.01.2010

dclaw, this is the 5th topic you have made about this ONE gate.