Auto Gate
#4

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;

Reply


Messages In This Thread
Auto Gate - by Seyed - 01.10.2017, 13:45
Re: Auto Gate - by Mister0 - 01.10.2017, 13:59
Re: Auto Gate - by Lokii - 01.10.2017, 14:07
Re: Auto Gate - by Seyed - 01.10.2017, 14:55
Re: Auto Gate - by Seyed - 01.10.2017, 15:08
Re: Auto Gate - by Lokii - 01.10.2017, 15:20
Re: Auto Gate - by Seyed - 01.10.2017, 15:36

Forum Jump:


Users browsing this thread: 1 Guest(s)