[Tutorial] how to make a mooving gate in a filterscript
#1

1-first
Код:
#include <a_samp>
#include <streamer>
2-
Код:
new gate; // change gate into what you like
3-
Код:
public OnFilterScriptInit()
{
4- Put your gate
Код:
gate = CreateObject(969, 1643.41736, -1719.34143, 14.67698, 0.00000, 0.00000, 89.94525);//gate closed
    return 1;
}
5- gate closed cmd
Код:
    if (!strcmp("/closegate", cmdtext)) // cmd to close the gate
   {
       if(IsPlayerInRangeOfPoint(playerid, 969, 1643.41736, -1719.34143, 14.67698))
        {
			MoveDynamicObject(gate, 1643.41736, -1719.34143, 14.67698, 1(here youu put the speed of moving), 0.00000, 0.00000,89.94525);//gate closed pos
		}
		return 1;
	}
5-gate opened cmd
Код:
    if (!strcmp("/opengate", cmdtext)) // cmd to open the gate
	{
	     if(IsPlayerInRangeOfPoint(playerid, 969(object id), 1643.41736, -1719.34143, 14.67698))
	{
			MoveDynamicObject(gate, 1643.45569, -1711.34302, 14.67698, 1(speed), 0.00000, 0.00000, 89.94525);//gate opened pos
   	}
		return 1;

    return 0;
   }
6-
Код:
   public OnFilterScriptExit()
  {
    return 1;
	}
* also you can added text message like:

SendClientMessage(playerid, 0xEF994300, "The gate has closed or opened.");

and a timer:

SetTimer("close", 7000, 0);//gate will be closed for 7 seconds

rep if i help you
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 3 Guest(s)