Lib usage
To import modules to your script you must add the following to the script fxmanifest.lua fileModule Import
List of Modules
- client
- server
modules (client)
modules (client)
entities (module)
entities (module)
blips (module)
blips (module)
inputs (module)
inputs (module)
prompts (module)
prompts (module)
commands (module) (client)
commands (module) (client)
points (module)
points (module)
polyzones (module)
polyzones (module)
events (module)
events (module)
dataview (module)
dataview (module)
streaming (module)
streaming (module)
Importing Modules
- LibImport
- Internal Import
- External Import
Import Usage
- Single Module Import
- Multiple Module Import
- Mixed Module Import
Single
Single
Modules Usage
The following modules are available in the lib, you can import them using theImport
function, documentation for each module will be available below
Entities
This module is used to create entities like peds, vehicles, objects, etc, it has a baseclass for all entities and sub classes for each entity type all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the entities will be removed for easy development it has a entity tracker if you wish to track the entities from other scripts (seecollector
file) for exports
- BASECLASS
- PED SUBCLASS
- VEHICLE SUBCLASS
- OBJECT SUBCLASS
Shared
Shared
Map
The map module is used to create blips for now but will be expanded to include more map related features when you restart your resource the blips will be removed for easy development- Map
Blip
Blip
Inputs
this module is used to create input controls for your resource, single or multiple , without the user having to create loops and a bunch of code all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the inputs will be removed for easy development- Inputs
Input
Input
- Setters
- Register
Destroy
Destroy
RemoveKey
RemoveKey
Pause
Pause
Resume
Resume
Update
Update
Start
Start
Prompts
this module is used to create prompts with coordinate-based activation, multiple prompts can be grouped together and managed as one unit all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the prompts will be removed for easy development- Prompts
Prompt
Prompt
- Getters
- Setters
- Register
GetHandle
GetHandle
GetPromptGroup
GetPromptGroup
GetGroupLabel
GetGroupLabel
IsRunning
IsRunning
Commands
this module is used to register client-side/server-side commands with permissions, suggestions, and argument validation all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the commands will be removed for easy development, if a command is active and suggestion hasnt been marked to add on register, it will be added on character selected automatically- Client
- Server
Command
Command
- Setters
- Register
Remove
Remove
AddSuggestion
AddSuggestion
RemoveSuggestion
RemoveSuggestion
Pause
Pause
Resume
Resume
Destroy
Destroy
Start
Start
OnExecute
OnExecute
OnError
OnError
Points
this module is used to create coordinate-based enter/exit areas with radius detection, multiple points can be registered and managed independently all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the points will be removed for easy development- Points
Point
Point
- Getters
- Setters
- Register
IsPointActive
IsPointActive
IsPointInside
IsPointInside
PolyZones
this module is used to create polygon, circle, or box shaped detection zones with height filtering, debug rendering, and enter/inside/exit callbacks all creations are instanced objects every zone instance is private to the script that imports it and will be removed automatically when the resource restarts- PolyZones
PolyZone
PolyZone
- Getters
- Configuration
- Lifecycle
- Register
GetId
GetId
GetType
GetType
poly
, circle
, or box
IsRunning
IsRunning
IsInside
IsInside
Events
this module is used to register game event listeners that can capture and process native game events with automatic data parsing all creations are instanced objects every creation will have its own instance and wont be shared with other scripts since its imported to your script when you restart your resource the event listeners will be removed for easy development- Events
Event
Event
- Setters
- Register
Start
Start
Pause
Pause
Resume
Resume
Destroy
Destroy
DataView
this module provides JavaScript-like DataView functionality for handling binary data in Lua with support for various data types and endianness this module is based on gottfriedleibniz’s DataView implementation providing efficient binary data manipulation- DataView
DataView
DataView
- Getters
- Setters
- Create
Buffer
Buffer
ByteLength
ByteLength
ByteOffset
ByteOffset
Data Type Getters
Data Type Getters
GetInt8(offset, endian)
- Read 8-bit signed integerGetUint8(offset, endian)
- Read 8-bit unsigned integerGetInt16(offset, endian)
- Read 16-bit signed integerGetUint16(offset, endian)
- Read 16-bit unsigned integerGetInt32(offset, endian)
- Read 32-bit signed integerGetUint32(offset, endian)
- Read 32-bit unsigned integerGetInt64(offset, endian)
- Read 64-bit signed integerGetUint64(offset, endian)
- Read 64-bit unsigned integerGetFloat32(offset, endian)
- Read 32-bit floatGetFloat64(offset, endian)
- Read 64-bit doubleGetString(offset, endian)
- Read null-terminated stringGetLuaInt(offset, endian)
- Read Lua integerGetLuaNum(offset, endian)
- Read Lua number
Fixed Size Getters
Fixed Size Getters
GetFixedString(offset, length, endian)
- Read fixed-length stringGetFixedInt(offset, length, endian)
- Read fixed-size signed integerGetFixedUint(offset, length, endian)
- Read fixed-size unsigned integer
Streaming
this module provides utility functions for loading various game assets like models, animations, textures, and more with automatic cleanup and timeout handling all functions handle the loading process with proper validation and error handling, preventing common issues with asset streaming- Streaming
Asset Loading
Asset Loading
- Models & Textures
- Animations & Weapons
- World & Collision
- Usage
LoadModel
LoadModel
LoadTextureDict
LoadTextureDict
Class
this module provides a complete object-oriented programming system for Lua with classes, inheritance, private members, and automatic getters/setters supports both traditional Lua OOP patterns and modern structured approaches with automatic property management was inspired by JavaScript classes- Class
OOP System
OOP System
- Class Creation
- Inheritance
- Getters & Setters
- Private Members
- Usage Examples
Create
Create
Functions
utility classes for control flow, timing, and conditional execution provides Switch-case patterns, repeating intervals, and one-time timeouts with full control over execution state shared between server and client environments- Switch
- Interval
- Timeout
Switch
Switch
Exports
Selector
This Selector allows you to select players with a NUI selector that will return the player id that was selected- Usage
Select
Select
ProgressBar
Allows you to create a progress bar that will be displayed on screen for a specified amount of time- Usage
Start
Start
startColor
and endColor
are the colors for the text and backgroundColor
and fillColor
are the colors for the background and the fill of the progress bar imagemilliseconds
for the progress barlinear
is avaliable for nowtop
and left
are the position in %
for the progress barpng
is avaliable for nowtrue
or false
if false
the progress bar was cancelledCancel
Cancel