SA-MP Forums Archive
[Tutorial] Creating an Automatic Gate - 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] Creating an Automatic Gate (/showthread.php?tid=202668)

Pages: 1 2 3


Re: Creating an Automatic Gate - Justinlampy - 03.03.2011

Nice tut.

but can i make an Filterscript From it ??


Re: Creating an Automatic Gate - Rolyy - 04.03.2011

Quote:
Originally Posted by Justinlampy
View Post
Nice tut.

but can i make an Filterscript From it ??
If you would ****** up "The Definition of Tutorials", You'll most probably get something related with: "An printed or digital manual where an software user using examples of the important parts of that software explains to others."

My point with that is, Tutorials is an theard with explaination for people to learn that is based on scripting.. And Not to release scripts..

Just saying.


Re: Creating an Automatic Gate - Ironboy - 04.03.2011

nice tutorial


Re: Creating an Automatic Gate - ParaMedicalzZ - 04.03.2011

Quote:
Originally Posted by Rolyy
View Post
If you would ****** up "The Definition of Tutorials", You'll most probably get something related with: "An printed or digital manual where an software user using examples of the important parts of that software explains to others."

My point with that is, Tutorials is an theard with explaination for people to learn that is based on scripting.. And Not to release scripts..

Just saying.
ROFL, This makes my day.
And indeed nice tutorial.


Re: Creating an Automatic Gate - justsomeguy - 05.03.2011

ey i get close to the gate but it doesnt open how to fix this? here is the code:
pawn Code:
public CheckGate()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 10.0, -1572.1834716797, 658.83563232422, 6.96250295639042))
            {
                MoveObject(AutomaticGate, -1572.1834716797, 658.83563232422, 6.9625029563904, 0, 90);
            }
            else
            {
                MoveObject(AutomaticGate, -1575.4208984375, 660.19921875, 6.1875, 0, 90);
            }
        }
    }
}
and here the warnings:
Code:
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\sf90s.pwn(1393) : warning 202: number of arguments does not match definition
C:\Program Files\Rockstar Games\GTA San Andreas\gamemodes\sf90s.pwn(1397) : warning 202: number of arguments does not match definition
i used these createobjects:
pawn Code:
CreateObject(968, -1572.1834716797, 658.83563232422, 6.9625029563904, 0, 90.250213623047, 90);
CreateObject(968, -1575.4208984375, 660.19921875, 6.1875, 0, 90.247192382813, 90);



Re: Creating an Automatic Gate - tanush - 07.03.2011

wtf D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1312) : warning 235: public function lacks forward declaration (symbol "CheckGate")
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1339) : warning 217: loose indentation
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1339) : error 029: invalid expression, assumed zero
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1339) : error 004: function "Streamer_OnPlayerDisconnect" is not implemented
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1342) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1343) : error 017: undefined symbol "reason"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1355) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1356) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1357) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(135 : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1359) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1360) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1361) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1362) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1366) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(136 : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1370) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1371) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1372) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1373) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1374) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1375) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1376) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1377) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(137 : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1379) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1380) : error 017: undefined symbol "playerid"
D:\Users\Tanush\Desktop\SA-MP\gamemodes\Server.pwn(1383) : error 017: undefined symbol "playerid"

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


26 Errors.


Re: Creating an Automatic Gate - AH.1990 - 19.03.2011

i did this but when iam alone in server it opens when someone connects it opens for him and doesnt open for me

pawn Code:
forward gatecheck();
public gatecheck()
{
    for(new i=0; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsPlayerInRangeOfPoint(i, 15.0,1545.93554688,-1626.52050781,12.58281231))
            {
                MoveObject(lspleftgate, 1545.93554688,-1617.52050781,12.58281231, 5.0);
                MoveObject(lsprightgate, 1545.93554688,-1635.82055664,12.58281231, 5.0);
            }
            else if(IsPlayerInRangeOfPoint(i, 15.0, 1140.91699219,-1292.01171875,12.68227100))
            {
                MoveObject(lsmgate1, 1148.21447754,-1292.01245117,12.68227100, 5.0);
                MoveObject(lsmgate2, 1133.91699219,-1292.01171875,12.68227100, 5.0);
            }
            else if(IsPlayerInRangeOfPoint(i, 15.0, 1591.87133789,-1638.18017578,13.89877319))
            {
                MoveObject(lspgar, 1591.87133789, -1638.18017578, 6.89877319, 5.0);
            }
            else
            {
                MoveObject(lspleftgate, 1545.93554688,-1626.52050781,12.58281231, 5.0);
                MoveObject(lsprightgate, 1545.93554688,-1626.82055664,12.58281231, 5.0);
                MoveObject(lsmgate1, 1141.21447754,-1292.01245117,12.68227100, 5.0);
                MoveObject(lsmgate2, 1140.91699219,-1292.01171875,12.68227100, 5.0);
            }
        }
    }
    return 1;
}



Re: Creating an Automatic Gate - Davz*|*Criss - 19.03.2011

Nice tutorial


Re: Creating an Automatic Gate - rtyd - 10.04.2011

Is there a way i can make it to were the gate will open only for 1 person?


Re: Creating an Automatic Gate - juraska - 23.05.2011

Good tutorial


Re: Creating an Automatic Gate - BaubaS - 23.05.2011

500s ? No way!


Re: Creating an Automatic Gate - Snipa - 23.05.2011

Quote:
Originally Posted by BaubaS
View Post
500s ? No way!
Not seconds, milliseconds.

500ms = 1/2 a second.. not 500 seconds..


Re: Creating an Automatic Gate - Dennis_Sanchez - 31.05.2011

hey lol
i get many erros but im putting in a filterscript ?
is that i get that many errors ?

Code:
C:\Users\Dennis\Downloads\server\filterscripts\AdminHouse2.pwn(551) : error 029: invalid expression, assumed zero
C:\Users\Dennis\Downloads\server\filterscripts\AdminHouse2.pwn(551) : error 004: function "CheckGate" is not implemented
C:\Users\Dennis\Downloads\server\filterscripts\AdminHouse2.pwn(552) : warning 217: loose indentation
C:\Users\Dennis\Downloads\server\filterscripts\AdminHouse2.pwn(557) : warning 202: number of arguments does not match definition
C:\Users\Dennis\Downloads\server\filterscripts\AdminHouse2.pwn(579) : warning 217: loose indentation
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase
im having already forward CheckGate();


how to fix errors please ?


im having this ..
Code:
public CheckGate()
    {
	    for(new i=0; i<MAX_PLAYERS; i++)
 	    	{
  		  if(IsPlayerConnected(i))
	                        {
         		            if(IsPlayerInRangeOfPoint(i, 10.0, -1184.54418945, -996.06542969, 130.38134766, 5.00))
           		                         {
				      MoveObject(AutomaticGate, -1184.2901611328, -996.14276123047, 123.37306976318 , 5.00);
					  }
	  					else
					  {
					  MoveObject(AutomaticGate, -1184.54418945, -996.06542969, 130.38134766, 5.0);
   				}
	  		}
		}
	}



Re: Creating an Automatic Gate - Jack_Rocker - 03.06.2011

nice tut


Re: Creating an Automatic Gate - Darnell - 10.08.2011

Fixed, awesome tutorial, but SA-MP's wiki guide is better.


Re: Creating an Automatic Gate - Amel_PAtomAXx - 26.08.2011

I think that for Automatic Gates is more simple to use like this :
pawn Code:
public OnPlayerUpdate(playerid)
{
    if(IsPlayerInRangeOfPoint(playerid,13.00,X,Y,Z)) // X,Y,Z Cordinates of closest gate
    {
        MoveDynamicObject(gate,X,Y,Z,2.00); // Cordinates of opened gate
        SetTimer("close",7000,false);
        return 1;
    }
   

    return 1;
}
forward close();
public close()
{
    MoveDynamicObject(gate,X,Y,Z,2.00); // Cordinates of closed gate
    return 1;
}
i was test it and it work for me..


Re: Creating an Automatic Gate - cs_waller - 30.12.2011

AWESOME


Re : Creating an Automatic Gate - Heni - 01.01.2013

Код:
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19133) : error 029: invalid expression, assumed zero
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19133) : error 004: function "CheckGate" is not implemented
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19148) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.



Re: Re : Creating an Automatic Gate - [NWA]Hannes - 02.01.2013

Quote:
Originally Posted by Heni
Посмотреть сообщение
Код:
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19133) : error 029: invalid expression, assumed zero
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19133) : error 004: function "CheckGate" is not implemented
C:\Users\Heni\Desktop\Express Gaming RP fixed\gamemodes\EGRP.pwn(19148) : warning 225: unreachable code
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Errors.
Post your code


Re : Creating an Automatic Gate - Heni - 03.01.2013

Fixed , Anyways Thanks...