Jump to content

[HELP]barrier Problem


ViRuZGamiing

Recommended Posts

Posted

Hi Community,

here's my script:

bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 0 ) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 0 ) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

My Problem:

I know it's something with my rX, rY or rZ.

My Original Coördinates:

Closed Barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 90, 90 

Open barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 90 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
Hi Community,

here's my script:

bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 0 ) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 0 ) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

My Problem:

I know it's something with my rX, rY or rZ.

My Original Coördinates:

Closed Barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 90, 90 

Open barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 90 

So whats the problem ? just change coordinates ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted

The Barrier don't opens and closes like it meant to be.

I only need to go up and down

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
The Barrier don't opens and closes like it meant to be.

I only need to go up and down

thats easy just get cooardinates of up and downside and change it and btw your original coordinates will rotate the gate and in script coordinates will do nothing

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 0,90 ) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 90, 90 ) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

try this.

Looking for tutorials or information? check out: www.simpleask.co.uk

Posted
bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, -90) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 90) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

CiTLh.png
Posted
bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, -90) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 90) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

are you sure you don't need Rz ?

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Posted
My Problem:

I know it's something with my rX, rY or rZ.

My Original Coördinates:

Closed Barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 90, 90 

Open barrier:

-1572.1999511719,658.90002441406,7.0999999046326, 0, 0, 90 

are you sure you don't need Rz ?

Since the Rz in Closed Barrier and in Opened barrier is the same, why do the hell i need it? :mrgreen:

CiTLh.png
Posted

I made a Map and Saved it with Barrier closed (took the Coordinates)

Saved again but then open (took the coordinates)

This are them.

@TAPL I will try your Script first

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted

Thanks it worked TAPL,

Can you tell me the ones for my last Barrier? Please

model=968 
  
gesloten 
posX=-1701.4000244141 posY=687.59997558594 posZ=24.799999237061 
rotX=0            rotY=270          rotZ=90 
open 
posX=-1701.4000244141 posY=687.59997558594  posZ=24.799999237061 
rotX=0            rotY=0             rotZ=90 

"If debugging is the process of removing software bugs, then programming must be the process of putting them in."

Posted
bargate = createObject (968,-1572.1999511719,658.90002441406,7.0999999046326,0,90,90) 
damarker = createMarker (-1572.1999511719,658.90002441406,7.0999999046326, "cylinder", 9.5, 255, 0, 0, 0 ) 
  
isMoving = false 
  
function gatefunc( hitPlayer ) 
   if ( getElementType ( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
   local veh = getElementModel ( getPedOccupiedVehicle ( hitPlayer ) ) 
        if ( veh == 597 ) and not isMoving then 
        isMoving = true 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, -90) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", damarker, gatefunc ) 
  
function gatefuncclose( hitPlayer ) 
    if ( getElementType( hitPlayer ) == "player" and isPedInVehicle( hitPlayer ) ) then 
    local veh = getElementModel( getPedOccupiedVehicle( hitPlayer ) ) 
        if ( veh == 597 ) and isMoving then 
        isMoving = false 
        moveObject( bargate, 1500, -1572.1999511719,658.90002441406,7.0999999046326, 0, 90) 
       end 
    end 
end 
addEventHandler( "onMarkerLeave", damarker, gatefuncclose ) 

are you sure you don't need Rz ?

Lol, i did'nt see Rz is in Bargate.

Multi Theft Auto Player since middle of 2011.

Everybody want to act Crazy/Smart/Intelligent/Different/Unique/Innocent and Thats why I am Perfect.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...