SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 01/10/2017, 01:45 PM   #1
Seyed
Little Clucker
 
Join Date: Sep 2017
Posts: 21
Reputation: 0
Default Auto Gate

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}
Seyed is offline   Reply With Quote
Old 01/10/2017, 01:59 PM   #2
Mister0
Huge Clucker
 
Mister0's Avatar
 
Join Date: Aug 2015
Posts: 220
Reputation: 19
Default Re: Auto Gate

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
}
}
Mister0 is offline   Reply With Quote
Old 01/10/2017, 02:07 PM   #3
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 375
Reputation: 91
Default Re: Auto Gate

i made an include for this:

http://forum.sa-mp.com/showthread.php?t=641392
Lokii is offline   Reply With Quote
Old 01/10/2017, 02:55 PM   #4
Seyed
Little Clucker
 
Join Date: Sep 2017
Posts: 21
Reputation: 0
Default Re: Auto Gate

Quote:
Originally Posted by Lokii View Post
Hi
i Can Use This Code?
PHP Code:
#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;

Seyed is offline   Reply With Quote
Old 01/10/2017, 03:08 PM   #5
Seyed
Little Clucker
 
Join Date: Sep 2017
Posts: 21
Reputation: 0
Default Re: Auto Gate

Quote:
Originally Posted by Lokii View Post
yes.
Emmmm.i Want To Add A Gate In this Location;
HTML Code:
2119.89111328,1916.40917969,10.59587479,179.99993896,-1,-1,900
And If Player Name Is Seyed
Gate Will Automatic Open.
Please Help
Seyed is offline   Reply With Quote
Old 01/10/2017, 03:20 PM   #6
Lokii
Huge Clucker
 
Join Date: Sep 2017
Posts: 375
Reputation: 91
Default Re: Auto Gate

PHP Code:
#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;

Lokii is offline   Reply With Quote
Old 01/10/2017, 03:36 PM   #7
Seyed
Little Clucker
 
Join Date: Sep 2017
Posts: 21
Reputation: 0
Default Re: Auto Gate

Quote:
Originally Posted by Lokii View Post
PHP Code:
#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
Seyed is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
auto gate GeneralAref Scripting Help 11 29/01/2016 10:47 AM
Auto gate help Toxik Scripting Help 3 02/05/2015 11:36 PM
Auto Gate Tanush123 Scripting Help 4 26/12/2011 03:19 PM
[HELP] auto gate Tom1412 Help Archive 4 25/03/2011 11:10 AM


All times are GMT. The time now is 11:39 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.