Jump to content

vehicle entry


sckatchof

Recommended Posts

hi all i need same , i want just vehicle entry to the marker !

local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
    end 
end 
  
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

Link to comment
if getElementType(hitPlayer) == "vehicle" then 

i try many but does not work

Like this ?!

  
local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if getElementType(hitPlayer) == "vehicle" then 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
    end 
end 
  
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if getElementType(hitPlayer) == "vehicle" then 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

Link to comment

Try this:

local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) ~= "vehicle") then return end 
    local hitPlayer = getVehicleOccupant(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
    end 
end  
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) ~= "vehicle") then return end 
    local hitPlayer = getVehicleOccupant(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

Link to comment
Try this:
local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) ~= "vehicle") then return end 
    local hitPlayer = getVehicleOccupant(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
    end 
end  
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) ~= "vehicle") then return end 
    local hitPlayer = getVehicleOccupant(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementPosition ( hitPlayer, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

does not work

Link to comment
local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) == "vehicle") then 
    local hitPlayer = getVehicleController(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    local vehicle = getPedOccupiedVehicle(hitPlayer) 
    if (getTeamName(team) == "Army") then 
        setElementVelocity(vehicle, 0, 0, 0) 
        setElementPosition ( vehicle, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
        end 
    end 
end 
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) == "vehicle") then 
    local hitPlayer = getVehicleController(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    local vehicle = getPedOccupiedVehicle(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementVelocity(vehicle, 0, 0, 0) 
        setElementPosition ( vehicle, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

Link to comment
local Carlbara = createMarker( 117.30000305176, 1885, 17, 'cylinder', 2.5, 255, 255, 255, 150 ) 
local Carlde5el = createMarker( 86.800003051758, 1771.3000488281, -29.39999961853, 'cylinder', 2.5, 255, 255, 255, 150 ) 
  
function Entrer( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) == "vehicle") then 
    local hitPlayer = getVehicleController(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    local vehicle = getPedOccupiedVehicle(hitPlayer) 
    if (getTeamName(team) == "Army") then 
        setElementVelocity(vehicle, 0, 0, 0) 
        setElementPosition ( vehicle, 90, 1771.3000488281, -28.39999961853 ) 
    else     
        outputChatBox ( "You cannot enter. You need to be a Army.",hitPlayer )               
        end 
    end 
end 
addEventHandler( "onMarkerHit", Carlbara, Entrer ) 
  
function Sortie( hitPlayer, matchingDimension ) 
    if (getElementType(hitPlayer) == "vehicle") then 
    local hitPlayer = getVehicleController(hitPlayer) 
    local team = getPlayerTeam(hitPlayer) 
    if (not team) then return end 
    local vehicle = getPedOccupiedVehicle(hitPlayer) 
    if (not team) then return end 
    if (getTeamName(team) == "Army") then 
        setElementVelocity(vehicle, 0, 0, 0) 
        setElementPosition ( vehicle, 117.69999694824, 1893.4000244141, 18.39999961853 ) 
        end 
    end 
end 
addEventHandler( "onMarkerHit", Carlde5el, Sortie ) 

thnx snake for ur help but when the vehicle enter the cylinder, it comes to another cylinder and it fliped

Link to comment

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...