Jump to content

[HELP]Re-attaching to moving object


Tombaa

Recommended Posts

I have been trying to use this script:

viewtopic.php?f=91&t=32662&p=344109&hilit=Attach#p344109

But the problem is, that when I once get it to attach, and detach after that, it wont attach to it anymore, before I restart script.

  
function attach ( hitElement ) 
    if ( getElementType( hitElement ) == "vehicle" ) then 
        attachElements ( arrow1, cH, -1417 - hullx, 531 - hully, 18.5 - hullz ) 
        attachElements ( hitElement, arrow1 ) 
    do 
    end 
end 
addEventHandler ( "onMarkerHit", theMarker, attach ) 
      
function detach ( thePlayer, commandName ) 
    local pVehicle = getPedOccupiedVehicle( thePlayer ) 
    detachElements ( pVehicle ) 
 end 
addCommandHandler ( "detach", detach ) 
  

That is the code, could anyone please tell me, if there is some kind of loop thing or something, which I can use there.

Thanks in advance

Tombaa

Edited by Guest
Link to comment

I just noticed, that it actually works, when the carrier is still, but when you move the carrier to somewhere else, than detach and try to attach again, than it wont attach again. If its in the same place as stated in the script, it does work.

How to fix it so that it attached everywhere? :S

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