Jump to content

Checking for cars.


dima3367

Recommended Posts

Hi all, tell me how to make my script ban on teleportation in the car and make it dosutpnoy only when the player is on foot.

local marker = createMarker(-1556.1298828125,-530.66552734375,13.1484375,"cylinder",1.5,230,0,85,225) -- это будет маркер в обычном мире, т.е. в нулевом измерении 
  
addEventHandler("onMarkerHit",marker, function (hitElement, matchingDimension) 
    if getElementType (hitElement) == 'player' and matchingDimension then 
        setElementPosition (hitElement,-3037.6647949219,1605.0709228516,39.676563262939) 
        setElementDimension (hitElement, 500) 
    end 
end) 
  
local markerD = createMarker(-3028.0424804688,1649.7550048828,38.817188262939,"cylinder",1.5,230,0,85,225) -- это уже будет маркер в другом измерении 
setElementDimension (markerD, 500) -- 5 - ид измерения 
  
addEventHandler("onMarkerHit",markerD, function (hitElement, matchingDimension) 
    if getElementType (hitElement) == 'player' and matchingDimension then 
        setElementPosition (hitElement,-1512.4594726563,-517.94372558594,14.1484375) 
        setElementDimension (hitElement, 0) 
    end 
end) 
  
  

Link to comment
local marker = createMarker(-1556.1298828125,-530.66552734375,13.1484375,"cylinder",1.5,230,0,85,225) -- это будет маркер в обычном мире, т.е. в нулевом измерении 
  
addEventHandler("onMarkerHit",marker, function (hitElement, matchingDimension) 
    if getElementType (hitElement) == 'player' and matchingDimension then 
        if ( isPedInVehicle ( hitElement ) ) then return end 
        setElementPosition (hitElement,-3037.6647949219,1605.0709228516,39.676563262939) 
        setElementDimension (hitElement, 500) 
    end 
end) 
  
local markerD = createMarker(-3028.0424804688,1649.7550048828,38.817188262939,"cylinder",1.5,230,0,85,225) -- это уже будет маркер в другом измерении 
setElementDimension (markerD, 500) -- 5 - ид измерения 
  
addEventHandler("onMarkerHit",markerD, function (hitElement, matchingDimension) 
    if getElementType (hitElement) == 'player' and matchingDimension then 
        if ( isPedInVehicle ( hitElement ) ) then return end 
        setElementPosition (hitElement,-1512.4594726563,-517.94372558594,14.1484375) 
        setElementDimension (hitElement, 0) 
    end 
end) 

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