Jump to content

[REL] Helicopter Grabbing v1.3


Remp

Recommended Posts

This is a resource for the nightly/1.0 build allowing players to jump, grab and hang onto parts of helicopters

763.png

By default, to grab a helicopter use the command /grab (or your jump key) when close to it, use /drop (or backspace) to drop off

These can be bound to keys with mta's bind command: /bind (eg: "/bind lshift down grab") (type "bind" into the console ingame to see the required syntax)

You can set the commands/binds used to grab and drop through the settings in the meta.xml

You will be automatically dropped from the heli if it gets close to the ground or your player collides with another element

I strongly advise you to not bind your enter_exit or enter_passenger keys to /grab or /drop as this can cause some very disruptive problems

Exported functions:

- toggleHangingWeightLimit(true/false) - this toggles the hanging weight limit on or off, defaults to on (meaning there are limits to how many people each helicopter can have hanging from it at a time, each helicopter is different)

- setPlayerGrabState(player, true/false, [ heli , side = "right", line_percent = 0.5]) - this forces the player hanging on (true) or off (false) a helicopter. Using this to hang players will bypass the hanging weight limit for that helicopter, there are also no suitability checks done so it is up to you to make sure the player can actually start hanging (ie: isnt attached to something, isnt dead, etc).

side indicates which side of the heli the player will hang onto, line_percent indicates how far along the grab lines the player will be hanging (0 for front, 1 for back)

- isPlayerGrabbingHeli(player) - returns true if they are, false if they arent. nil if player is invalid

- getPlayerGrabData(player) - returns heli,side,line_percent,legs_up if they are hanging, nil if they arent or an invalid player is passed

- getPlayersGrabbingHeli(heli, [side, line]) - returns a table of all players hanging on the heli, nil if there are no players or the heli is invalid

Example videos:

Download:

https://community.multitheftauto.com/index.php?p= ... ils&id=357

Known issues:

- occasionally the animation wont loop properly and the player will not swing, they will just hang in a static position

- using the same key as enter_exit / enter_passenger for grabbing can cause you to not be able to walk forward until you jump, be stuck in water unable to jump until you swim to land again or unable to get in/out of vehicles

- using the same key as enter_exit for dropping causes you to jack the driver of water vehicles if you drop while they are parked on the water (due to the entry warping)

Edited by Guest
Link to comment
I've test it with some people, i think that is to hard to grab a heli, you should make a bigger col or something.

Its a real cool script! 5/5

Trust me it is not too hard lol, it requires some skills but it makes it more fun. :P

Link to comment

What do you mean by not well? it worked fine for me during testing (though i have a modified parachute resource). There is very little i can do about this really as its the responsibilty of the parachute resource itself, if you can find exact steps to invoke a notably bad response from it you could report it

Link to comment
What do you mean by not well? it worked fine for me during testing (though i have a modified parachute resource). There is very little i can do about this really as its the responsibilty of the parachute resource itself, if you can find exact steps to invoke a notably bad response from it you could report it

Well, when the heli forward leaning, to go forward and you jump off with your parachute, the parachute fall is not right, you fall something like "/" if you have the parachute on.

Link to comment
  • 1 month later...

new version uploaded, this fixes a bug with destroying helis while hanging, improves overall robustness of code and adds 3 new exported functions:

- IsPlayerHangingFromHeli(player) - returns true is they are, false if they arent. nil if player is invalid

- GetPlayerHangingData(player) - returns heli,side,line_percent,legs_up if they are hanging, nil if they arent or an invalid player is passed

- GetPlayersHangingFromHeli(heli, [side, line]) - returns a table of all players hanging on the heli, nil if there are no players or the heli is invalid

Link to comment

love ths script, but i still say you need to simplify it by checking if the player is double tapping jump to get on (meaning pressing jump key while already in the air), then jump again while hanging to get off. that way its unobtrusive to gameplay and no need for unneccesary binds.

Link to comment

i actually have /grab bound to my jump key already and id argue that being forced to use specific keys (either changed and therefore unknown between servers or not) is more obtrusive :P

having said that, if its an issue you can easily comment the command handlers and add your own bind lines

jumping again to drop can be a problem when people spam jump to get on, only to find they pressed it one too many times and dropped off again

Link to comment
  • 4 weeks later...

I have updated the resource to allow easy manipulation of the default commands and binds for grab/drop

You can now set the names of the commands or the keys/controls you want to bind through the settings in the meta.xml to streamline the process of changing the binds should you want to

The default commands/binds are now:

to grab - /grab, /heligrab or your jump key

to drop - /drop, /helidrop or your backspace key

Link to comment
  • 4 months later...
I have updated the resource to allow easy manipulation of the default commands and binds for grab/drop

You can now set the names of the commands or the keys/controls you want to bind through the settings in the meta.xml to streamline the process of changing the binds should you want to

The default commands/binds are now:

to grab - /grab, /heligrab or your jump key

to drop - /drop, /helidrop or your backspace key

Hello there remp, i have noticed this resource sometimes this resource output some errors on console, are they corrected on this new version?

regards

Link to comment

Remp:

the error:

mtaheli.jpg

Click on the link to see it better ( -.- sorry i only noticed now it dont allow + then 800 x 600 )

http://www.mini-missions.net/resources/mta-screen%202010-01-27%2022-38-39.png

If you are accepting any suggestions for this resource ...

Would also be amazing if they could grab but instead of with hands, lets say they would just "attach to the heli" and able to aim and shot from there. ( i cant explain more my english sucks :S )

Link to comment
  • 3 weeks later...

sadly, shooting while hanging would be very tricky to do (if possible). currently the only way for you to shoot like that is to enable driveby, which requires you to be inside a vehicle. so you'd have to create invisible vehicles, attach them to heli then driveby from it, which wouldn't even look like hanging anyway

i'm unsure if you can shoot while attached to something, so i don't know if simply 'standing' on the side of the heli and shooting normally would work

as for climbing into the heli while hanging, this is probably possible but it wouldn't look very good at all

i actually fixed the errors you posted a few months ago, but i must have forgotten to upload it. id like to re-write parts of the code again now, so (as its a relatively minor problem) i'll hold that fix for a more substantial release

Link to comment
  • 3 months later...

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