Elder0ne / mh-carlift

This add multi fully fonctional car lifts in your world

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hi πŸ‘‹, I'm MaDHouSe

A passionate allround developer

mh-carlift

This add multi fully fonctional car lifts in your world you can add more if you want.


This script is setup for my mh-scrapyardMLO download here


Yes i know this 😁

  1. Yes, there will always be platforms on the ground even if you use the car lift,
  • I did this because if I don't, the car lift won't work properly..
  1. Yes on your screen if you use the lift wil work good.
  • Yes on your screen the elevator will work well and go smoothly if you use it,
  • by other players, it can hop a little bit on there screen.
  • don't set the speed for the carlift too high.

Video

Demo

πŸ“Έ Screenshot πŸ‘ŠπŸ˜πŸ‘

foto1 foto1

To setup other car lifts in your world

-- if your Z axes in your coords is 5.0 your min is 5.0 and befmore min is 4.5 or 4.0 same for the up but the other way...

[1] = {               	                     -- this and the id, must be the same number. (a unique number)
    id        = 1,    	                     -- this needs the id from above. 
    min       = 47.37, 	                     -- lower position of the lift (z from the main coords)
    max       = 49.45, 	                     -- higher position of the lift (z from the main coords)
    beforemax = 45.53, 	                     -- detector for speed_up_slow befor the final point (z from the main coords)
    beforemin = 48.00, 	                     -- detector for speed_down_slow befor the final point (z from the main coords)
    entity    = nil,   	                     -- dont change this
    needPoles = false,                       -- if dont have poles set this true
    openMenu  = true,                        -- if you want to have a menu on the lift, false if you have other plans with it.
    workarea  = {length = 7.0, wide = 7.0 }, -- length and wide of the box zone
    job       = {"mechanic", "scrapyard"},   -- job access
    coords    = {["x"] = 2345.31, ["y"] = 3141.512, ["z"] = 47.37874, ["h"] = -189.5}, -- start base coords of this lift platform.
}, 

Use the exports to get the Closest Lift ID

local id, distance, entity, coords = exports['mh-carlift']:GetClosestLiftObject()`

Example to get the Closest Lift

Citizen.CreateThread(function()
    while true do
        Citizen.Wait(0)
	local id, dist, entity, coords = exports['mh-carlift']:GetClosestLiftObject()
	local elevatorCoords = GetEntityCoords(entity, false) -- to get the closest car lift near you
	Wait(100)
    end
end)

Example how to use this in other scripts, to interact with the lift.

  • if you have a other script and you want to move the lift up or down, you can use this.
local data = {}
data = {handle = "up", id = id} end   -- go up
data = {handle = "down", id = id} end -- go down
data = {handle = "stop", id = id} end -- stop

TriggerServerEvent('mh-carlift:server:use', data) -- take the data you need

Contributers

🐞 Any bugs issues or suggestions, let my know. πŸ‘ŠπŸ˜Ž

πŸ™ˆ Youtube & Discord

LICENSE

GPL LICENSE
Β© MaDHouSe79

About

This add multi fully fonctional car lifts in your world

License:GNU General Public License v3.0


Languages

Language:Lua 100.0%