[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
#2

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

Too bad lack explanation!
and not a tutorial.
Reply
#4

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
Reply
#5

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
Reply
#6

Quote:

Too bad lack explanation!
and not a tutorial.

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

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
Reply
#8

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.
Reply
#9

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".
Reply
#10

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)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)