Configuration
info
You can find config file in no-gps-tracker/config/shared.lua
Inventory
| Option | Type | Description |
|---|---|---|
| Enabled | boolean | Enable or disable the GPS tracker inventory item functionality |
| TrackerItemName | string | The name of the GPS tracker item in the inventory system |
Tracker
| Option | Type | Description |
|---|---|---|
| ControllerInterval | number | Interval in milliseconds for how often the tracker controller ticks to record data points. Higher values reduce server load but decrease tracking accuracy. Minimum recommended is 2000 (2 seconds) |
| GlobalVehicleScanInterval | number | Interval in milliseconds for how often to scan all vehicles for trackers that are not currently attached. Minimum recommended is 30000 (30 seconds) |
| DeleteTrackerIfNoAccess | boolean | Deletes tracker if no one has access to it anymore. Good for cleanup of abandoned trackers |
Custom Functions
GetEntityIdentifier
Gets entity identifier (plate, VIN, etc). Return nil if you don't want this entity to be tracked.
---@param entity number The entity to get the identifier for.
---@return string|nil The identifier for the entity or nil if not found.
GetEntityIdentifier = function(entity)
-- By default use vehicle plate as identifier
-- You should use VIN or other unique identifier if possible
return GetVehicleNumberPlateText(entity)
end
GetIsEntityPersistent
Checks if entity is persistent (can be found later like player vehicles). This is required for optimized tracker lookups.
---@param entity number The entity to check.
---@param entity_identifier string This matches what GetEntityIdentifier returns.
---@return boolean is_persistent True if the entity is persistent, false otherwise.
GetIsEntityPersistent = function(entity, entity_identifier)
-- By default it assumes vehicles with NPC style plates are not persistent
-- GTA V NPC plates are 8 chars and in format like 12ABC345 unless changed
if #entity_identifier == 8 and entity_identifier:match("^%d%d[A-Z][A-Z][A-Z]%d%d%d$") then
return false -- Do not persist NPC vehicles
end
-- You should implement your own logic to determine if the entity is persistent
-- Such as is it owned by a player, is it registered in a database, etc.
return true -- Assume persistent
end
tip
For best performance, use fast checks like Entity(entity).state.is_owned instead of database queries in GetIsEntityPersistent, as this function is called frequently.