SA-MP Forums Archive
Auto 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)
+--- Thread: Auto Gate (/showthread.php?tid=642486)



Auto Gate - Seyed - 01.10.2017

Hi All
How To Do when I'm On The Gate,Gate Automatic Opened And Dont Need To Type /og Or ....
Please Help
{Sorry For My Bad English}


Re: Auto Gate - Mister0 - 01.10.2017

try to make a timer on ongamemodeinit with a second iterval
and on it put that command
if is player in range of point
{
if playerinfo playerid pfaction ==

moveobject
}
}


Re: Auto Gate - Lokii - 01.10.2017

i made an include for this:

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


Re: Auto Gate - Seyed - 01.10.2017

Quote:
Originally Posted by Lokii
Посмотреть сообщение
Hi
i Can Use This Code?
PHP код:
#include <a_samp>
#include <AutoMove>
#define FILTERSCRIPT
public OnFilterScriptInit()
{
    
CreateAutoObject(0971551.221011659.319959.592220.000000.00000304.77103, -1, -175.015.0557.700561650.478279.592220.000000.00000304.771033);  //Cars only.
    
CreateAutoObject(1971532.479371688.4017310.330700.000000.0000026.49157, -1, -195.020.0532.479371688.401736.192460.000000.0000026.491572); //Players only.
    
CreateAutoObject(2971, -62.404471341.030039.790370.000000.000000.00000, -1, -1100.510.0, -59.967751344.003919.790370.000000.00000300.65152.5); //Cars and Players.
    
return 1;
}
public 
OnAutoObjectOpen(playeridauto_objectid)
{
    switch(
auto_objectid)
    {
        case 
0//object id 0, can enter only while in vehicle
        
{
            if(
IsPlayerInAnyVehicle(playerid))  //if player enter with vehicle open
            
{
                
SendClientMessage(playerid0xFFFF00FF"Welcome");
            }
            else 
//if player enter on foot dont open
            
{
                
CloseAutoObject(0);  //were using the close function because it automaticly opens, so if we want the object to stay and not move we have to use that function
                
SendClientMessage(playerid0xFF0000FF"You have to be in a vehicle");
            }
        }
        case 
1:
        {
            if(!
IsPlayerInAnyVehicle(playerid)) //opposite of id 0
            
{
                
SendClientMessage(playerid0xFFFF00FF"Welcome");
            }
            else
            {
                
CloseAutoObject(1);
                
SendClientMessage(playerid0xFF0000FF"Vehicles are not allowed");
            }
        }
        case 
2//opens not matter on foot or in vehicle
        
{
            
SendClientMessage(playerid0xFFFF00FF"Welcome");
        }
    }
    return 
1;




Re: Auto Gate - Seyed - 01.10.2017

Quote:
Originally Posted by Lokii
Посмотреть сообщение
yes.
Emmmm.i Want To Add A Gate In this Location;
Код HTML:
2119.89111328,1916.40917969,10.59587479,179.99993896,-1,-1,900
And If Player Name Is Seyed
Gate Will Automatic Open.
Please Help


Re: Auto Gate - Lokii - 01.10.2017

PHP код:
#include <a_samp>
#include <AutoMove> //make sure that you have YSI
#define FILTERSCRIPT
public OnFilterScriptInit()
{
    
CreateAutoObject(09712127.216551913.2699013.356340.000000.000004.02577, -1, -1100.015.02116.996091912.2789313.356340.000000.000004.025773);
    
//usage CreateAutoObject(id, modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, Float:stream_distance, Float:move_distance, Float:tox, Float:toy, Float:toz, Float:torx, Float:tory, Float:torz, Float:move_speed);
    
return 1;
}
public 
OnAutoObjectOpen(playeridauto_objectid)
{
    new 
name[24];
    switch(
auto_objectid)
    {
        case 
0//checking if the auto object id is 0
        
{
            
GetPlayerName(playeridnamesizeof(name)); //getting player name
            
if(strcmp(name"seyed"true) != 0) return CloseAutoObject(0); //if doesnt match close gate if match gates will open
        
}
    }
    return 
1;




Re: Auto Gate - Seyed - 01.10.2017

Quote:
Originally Posted by Lokii
Посмотреть сообщение
PHP код:
#include <a_samp>
#include <AutoMove> //make sure that you have YSI
#define FILTERSCRIPT
public OnFilterScriptInit()
{
    
CreateAutoObject(09712127.216551913.2699013.356340.000000.000004.02577, -1, -1100.015.02116.996091912.2789313.356340.000000.000004.025773);
    
//usage CreateAutoObject(id, modelid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz, worldid = -1, interiorid = -1, Float:stream_distance, Float:move_distance, Float:tox, Float:toy, Float:toz, Float:torx, Float:tory, Float:torz, Float:move_speed);
    
return 1;
}
public 
OnAutoObjectOpen(playeridauto_objectid)
{
    new 
name[24];
    switch(
auto_objectid)
    {
        case 
0//checking if the auto object id is 0
        
{
            
GetPlayerName(playeridnamesizeof(name)); //getting player name
            
if(strcmp(name"seyed"true) != 0) return CloseAutoObject(0); //if doesnt match close gate if match gates will open
        
}
    }
    return 
1;

So Tnx