Skip to content

Releases: overextended/ox_lib

v2.1.0

25 Mar 10:52
Compare
Choose a tag to compare

Feature

Implement the "points" API to perform simple optimised distance checks.

  • Trigger a callback when leaving, entering, or within range of a "point".
  • The "nearby" callback is triggered on-frame, so it can be used for drawing text, markers, etc.
--@coords vector3
--@distance number
--@data table
local point = lib.points.new(coords, 5, {
	dunak = 'is a nerd',
})

function point:onEnter()
	print('entered range of point', self.id)
end

function point:onExit()
	print('left range of point', self.id)
end

function point:nearby()
	DrawMarker(2, self.coords.x, self.coords.y, self.coords.z, 0.0, 0.0, 0.0, 0.0, 180.0, 0.0, 1.0, 1.0, 1.0, 200, 20, 20, 50, false, true, 2, nil, nil, false)

	if self.currentDistance < 1 and IsControlJustReleased(0, 38) then
		print('inside marker', self.id)
		print(self.dunak)
	end
end

Tweaks

Minor performance tweak to cache.
cache.seat will update when shuffling (previously required re-entering a vehicle).
Extra error handling.

Full Changelog: v2.0.1...v2.1.0

v2.0.1

04 Mar 00:27
55c32d9
Compare
Choose a tag to compare

Full Changelog: v2.0.0...v2.0.1

v2.0.0

02 Mar 06:53
2a14391
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v1.5.0...v2.0.0

v1.5.0

28 Feb 02:51
Compare
Choose a tag to compare
refactor(init): call imports and exports via lib

Deprecate import (now just references lib); when calling or indexing
lib for the first time, attempt to load a module else call an export.