Jump to content

Attach weapon


TheNightRider

Recommended Posts

Hi am trying to attach a minigun to a hydra am just wondering how would it be possible.

The other thing is ive made a script which creates a hydra and a platform the platform does move an the hydra with it as 1 element. However I want the script to deattach after the platform as stopped moving.

  
  
platform = createObject ( 3115,-1807.3857421875, 558.2412109375, 58.630416870117) 
Hydra = createVehicle (520, -1806.5009765625, 559.37109375, 60.620552062988, 0, 0, 300.44860839844) 
weapon = createObject( 362, 0,0,0) 
  
  
addEventHandler ( "onResourceStart", getRootElement(), onstartup ) 
addEvent ( "hit", true ) 
function hit ( pla, dim, hitElement ) 
  
    if getElementType ( pla ) ~= "player" then 
    if vehicle or not vehicle then 
        aclGroupListACL ( aclgroup, Admin ) if 
         isObjectInACLGroup ( "user."..getPlayerName(pla), aclGetGroup ( "Admin" ) ) then 
         attachElements(Hydra, weapon, 0, 0, 4) 
         attachElements(Hydra, platform, 0, 0, 2) 
         moveObject (platform, 30000, -1807.3857421875, 558.2414109375, 233.22088623047) 
         else 
         outputChatBox ( "you don't have permisson to enter", pla, 255, 0, 0 ) 
         end 
         local vehicle = getPedOccupiedVehicle ( pla ) 
        if vehicle then 
         detachElements (Hydra, platform, 0, 0, 2 ) 
         
          else 
          return 0 
  
                end 
            end 
        end 
    end 
  
  
addEventHandler ( "onColShapeHit", g_base_col, hit) 
addEventHandler ( "hit", g_root, hit) 
  
  

Link to comment

Dont listen to these guys, because it is possible by attaching that flying rc (whatever its called) to your vehicle and use setElementSyncer (or create a ped and control the peds keyState).

you can attach it at the same position as the minigun and change alpha on the rc to 0.

Link to comment

as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world.

only thing that could cause it not to work is peds not shooting when on ground.

and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra.

Link to comment
as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world.

only thing that could cause it not to work is peds not shooting when on ground.

and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra.

That's so funny what he wrote about how do you set timer to 5 mins lol

answer is within the question lol

Link to comment
as azeru said create ped that has infinite minigun, bind your keys to change peds fire key state, attach to hydra, set you as syncer, set his alpha to 0, and attach minigun object to same position.make ped uncollidable with hydra, object, and probably even world.

only thing that could cause it not to work is peds not shooting when on ground.

and solidsnake, it doesnt have that much power, but it has ~45degree autolock that is surely needed for hydra.

creating a ped and attaching it to the vehicle and then firing with its weapon is a bad idea, it wont work because of a mta or gta bug where the bullets go in the opposite direction downwards of the vehicle velocity (if you try to shoot forward, you will shoot your own vehicle)

creating a few rc's (or a hunter) and then attach it at the same position as a minigun object and then setElementSyncer would be best. (i have tried all these before, and this idea worked the best)

Link to comment

I would not advise anyone to attach a hunter to a hydra and hide the hunter by setting its alpha to 0 or something. It would come with its own problems. It would be a lot better to attach a RC instead even though as Castillo rightly said their fire power isn't as good as a mini-gun. I am thought of a much better idea, using the use of drawline or whatever to create a laser effect and set vehicle to blow when the line hits it. It could be done so the vehicle does not blow straight away so in other words use some type of time duration of the line hitting the target would probably do the trick. Could also set a timer so the laser pulses along with some sort of laser sound effect would do the trick i guess. I have not looked into it much as of yet but am sure its possible. It is a real shame MTA doesn't support attaching Ped weapons to vehicles :( if it did it would be more practictical and would by a perhaps would be better in performance :D

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