Jump to content

Disable Vehicle following


Xwad

Recommended Posts

Hi i want to disable the heatseeking on weapon 36. I mean disable that the projectile cant follow the vehicle. I have a script but it dosent work.

  
-- this would stop projectile from being created if it wants to target someone 
function disableHeatSeek() 
   if getProjectileTarget(source) then 
      cancelEvent() 
   end 
end 
addEventHandler("onClientProjectileCreation",root,disableHeatSeek) 
  

Link to comment
addEventHandler ( "onClientProjectileCreation", root, 
    function ( ) 
        if ( getProjectileType ( source ) == 20 ) then 
            destroyElement ( source ) 
        end 
    end 
) 

Put it on client side.

If youre going to destroy a rocket it will actually explode, possibly killing the player firing it. I'd change the dimension first.

Link to comment

Well, didn't know that. If so, use that

addEventHandler ( "onClientProjectileCreation", root, 
    function ( ) 
        if ( getProjectileType ( source ) == 20 ) then 
            setElementDimension ( source, math.random ( 2, 999 ) ) 
            destroyElement ( source ) 
        end 
    end 
) 

Link to comment
addEventHandler("onClientProjectileCreation", root, 
function() 
    if getProjectileType(source) == 20 and getProjectileTarget(source) then 
        setElementPosition(source, 0, 0, -2000) 
        destroyElement(source) 
    end 
end) 

Link to comment

I made the same thing and just cancelled the explosion event ;-)

But it had issues because the explosion was not cancelled for other players AND the new created missile was not synced with other clients, so I had a serious sync issue. I did not continue developing this since then due to lack of time but I will continue soon.

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