SA-MP Forums Archive
[Tutorial] Simple Automatic Gate [No Command Need] - 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] Simple Automatic Gate [No Command Need] (/showthread.php?tid=424439)



Simple Automatic Gate [No Command Need] - Fitri - 22.03.2013

GATE TUTORIAL

Quote:

new mygate;

define it

Quote:

SetTimer("mygate",3500,true); //speed of the gate opend

Now,Create The GatesWhere You Gate..

Quote:

mygate = CreateObject(980, 898.536437, 2088.507324, 10.820312, 0.000000, 0.000000, 90.000000);//gate closed

AUTO OPEND

Quote:

public OnPlayerUpdate(playerid)
{
if(IsPlayerInRangeOfPoint(playerid, 5.0 ,x,y,z))//example 898.536437,2088.507324,10.820312)) 5.0 is size of range
{
MoveObject(mygate,898.536437, 2076.507324, 10.820311,2.5);//then,,gate was closed
return 1;
}
}

Gate Opend

Quote:

forward mygate(playerid);
public mygate(playerid)
{
MoveObject(mygate, 898.536437, 2088.507324, 10.820312,2.5);//2.5 is speed
return 1;
}

OK TNX XD


Re: Simple Automatic Gate [No Command Need] - Ryan_Bowe - 22.03.2013

Explain more?


Re: Simple Automatic Gate [No Command Need] - Yves - 23.03.2013

lol Explain more this ant going to help a newbie!