Home
Home
Register
Login

Resources
Forum






rssHelicopter Grabbing (heligrab)

Category:misc
Author:R3mp
Downloads:30566
Rate:You need to be logged in to vote
Rating:3.8 (158 Votes)
Description:
This is a resource allowing players to jump, grab and hang onto parts of helicopters

Forum thread: http://forum.multitheftauto.com/viewtopic.php?f=91&t=24919

Example videos:
http://www.youtube.com/watch?v=FkLzCt7Z4Ag
http://www.youtube.com/watch?v=WNXpruwMBTs

To grab a helicopter, the default commands are /grab (or your jump key) when close to it and /drop (or your backspace key) to drop off

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

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

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

(more)

Comments (10) | Download latest version | Report

Version history

Version Publish Date Changes
1.5.0 2017-09-28 22:33:12 Fixed a widespread abusable glitch (desyncing yourself/invulnerability by switching dim/int while hung on heli) Download
1.3.0 2012-05-22 19:15:58 rewrote parts for better performance, renamed exports to use proper naming conventions, misc cleaning Download
1.2.1 2012-01-29 03:15:38 Improved client CPU usage by using the bStreamedIn parameter of getElementsByType

- Cazomino05.
Download
1.2.0 2009-09-19 02:06:56 added meta.xml settings for controlling the commands/binds for grabbing and dropping Download
1.1.1 2009-08-27 05:29:03 renamed function to fit with exports Download
1.1.0 2009-08-27 05:00:19 fixed error with destroying helis while hanging, exported: IsPlayerHangingFromHeli(), GetPlayerHangingData() and GetPlayersHangingFromHeli() Download
1.0.0 2009-07-20 02:11:00 First public release Download