Guest Posted January 11, 2008 Share Posted January 11, 2008 Morning, I want to create blip attached to vehicle, but I want that this blip will visible only when player near this car (or in сertain distance between him and car) How can I do it? Link to comment
Twig Posted January 14, 2008 Share Posted January 14, 2008 px,py,pz = getElementPosition( getLocalPlayer() ) vehicles = getElementsByType ( "vehicle" ) for vehicleKey, vehicleValue in ipairs(vehicles) do carx,cary,carz = getElementPosition( vehicleValue ) pcDist = getDistanceBetweenPoints2D ( px, py, carx, cary ) if pcDist <= 200 then blip = createBlipAttachedTo ( vehicleValue, 0, 0.6, 200, 0, 0 ) end end This is part of a larger client side script and does it for ALL cars, so you'd have to modify it. Hope it points you in the right direction. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now