SA-MP Forums Archive
[Tutorial] how to make a mooving gate in a filterscript - 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: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] how to make a mooving gate in a filterscript (/showthread.php?tid=442524)



how to make a mooving gate in a filterscript - ViperKill - 07.06.2013

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


Re: how to make a mooving gate in a filterscript - [ABK]Antonio - 08.06.2013

You should explain more and use the [pawn ] tags (without the space of course).


Re: how to make a mooving gate in a filterscript - mau_tito - 08.06.2013

Too bad lack explanation!
and not a tutorial.



Re : Re: how to make a mooving gate in a filterscript - ViperKill - 08.06.2013

Quote:

You should explain more and use the [pawn ] tags (without the space of course).

sorry this is my first tuto

and

ill try to explain more than this


___________________________________
message me if ou need help with mooving gates


Re: how to make a mooving gate in a filterscript - Scenario - 08.06.2013

You haven't even explained ANYTHING on this so-called "tutorial." If I were you, I would check out ******'s tutorial on writing tutorials. I think a lot of people could benefit from reading this...

https://sampforum.blast.hk/showthread.php?tid=65567


Re : how to make a mooving gate in a filterscript - ViperKill - 08.06.2013

Quote:

Too bad lack explanation!
and not a tutorial.

i do my best to explain and you need to try it to understand


Re : how to make a mooving gate in a filterscript - ViperKill - 08.06.2013

Quote:

You haven't even explained ANYTHING on this so-called "tutorial." If I were you, I would check out ******'s tutorial on writing tutorials. I think a lot of people could benefit from reading this...

https://sampforum.blast.hk/showthread.php?tid=65567
thx for helping .like i say this is my first tuto
and i edit the tuto 4 times. hope everyone understand


Re: how to make a mooving gate in a filterscript - DobbysGamertag - 08.06.2013

Good job if its your first. But you could go better in places. Such as ZCMD, its quicker, and looks better instead of a huge block of OnPlayerCommandText. You should explain the stuff such as CreateDynamicObject, compared to CreateObject, if i was a noob coming here, and i saw that i'd rage like hell not knowing what it is.


Re: how to make a mooving gate in a filterscript - Marricio - 08.06.2013

This is not a tutorial, at all. I don't even think this would work as you create an object but /(open/close)gate uses a dynamic object function. Also, in /opengate you try to open the object "behindlspd" and in /closegate you try to close the object "name" after you named the object "gate".


Re : Re: how to make a mooving gate in a filterscript - ViperKill - 08.06.2013

Quote:

Also, in /opengate you try to open the object "behindlspd" and in /closegate you try to close the object "name" after you named the object "gate".

thx for reporting this bug. i already fix it
also this works and tested by me
(if you copied the gates pos codes this will not gonna work use your own gate pos codes)