Server Exports
Use these server-side exports to integrate Kartik Evidence with your world events and background scripts.
AddEvidenceToCoords
exports['kartik-evidence']:AddEvidenceToCoords(coords, evidenceType, metadata)๐น Description
Spawns a specific piece of evidence at a location in the world.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
coords | vector3 | The world coordinates. |
evidenceType | string | The type (e.g. blood, casing). |
metadata | table | Metadata like dna, fingerprint, or caliber. |
AddEvidenceToPlayer
exports['kartik-evidence']:AddEvidenceToPlayer(targetSource, evidenceType, metadata)๐น Description
Attaches evidence directly to a player (e.g. gunpowder residue or footprints).
AddEvidenceToEntity
exports['kartik-evidence']:AddEvidenceToEntity(entity, evidenceType, metadata)๐น Description
Attaches evidence to a vehicle or prop, allowing it to move with the entity.
RegisterProcessingHandler
exports['kartik-evidence']:RegisterProcessingHandler(itemName, machineType, callback)๐น Description
Defines the server-side logic that occurs after an item is processed in a forensic machine.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
itemName | string | The item being processed. |
machineType | string | Centrifuge, DnaScanner, etc. |
callback | function | The logic to execute (params: source, slot, itemData). |
GiveItem / RemoveItem
exports['kartik-evidence']:GiveItem(source, item, count, metadata)
exports['kartik-evidence']:RemoveItem(source, item, count, metadata, slot)๐น Description
Framework-agnostic helpers for item management. These automatically interface with the active inventory bridge (Ox, QB, etc.).
GetPlayerBiometrics
local data = exports['kartik-evidence']:GetPlayerBiometrics(citizenId)๐น Description
Retrieves the stored DNA and Fingerprint identifiers for a specific Citizen ID.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
citizenId | string | The unique citizen identifier to look up. |
๐ฆ Returns
Returns a table containing dna, fingerprint, isDnaTaken, and isFingerprintTaken, or nil if not found.
GetCaseFullDetails
local caseDetails = exports['kartik-evidence']:GetCaseFullDetails(caseId)๐น Description
Fetches the complete details of a crime scene case, including metadata, linked physical items from the stash, and linked biometric references.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
caseId | number | string | The ID of the forensic case. |
๐ฆ Returns
Returns a table containing case details (or nil if not found):
id(number): Case ID.title(string): Title of the case.officer(string): Investigator's name.officerCid(string): Investigator's Citizen ID.location(string): Location of the crime scene.narrative(string): Case description/notes.status(string): Current case status (e.g.,'active').images(table): Array of linked images.items(table): Array of linked physical items in the case locker.biometrics(table): Array of linked biometrics.created_at(string): Timestamp of creation.
GetBiometricData
local biometricVal = exports['kartik-evidence']:GetBiometricData(source, type)๐น Description
Retrieves the DNA or fingerprint identifier for a specific player source. If the player's evidence has not been loaded yet, it will load/generate it from the database first.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
source | number | The player's server ID. |
type | string | The biometric type ("fingerprint" or "dna"). |
๐ฆ Returns
Returns a string representing the biometric code, or nil if not found or invalid.
ClearGSR
exports['kartik-evidence']:ClearGSR(source)๐น Description
Clears Gunshot Residue (GSR) for a specific player.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
source | number | The player's server ID. |
SetResidueStatus
exports['kartik-evidence']:SetResidueStatus(source, state)๐น Description
Sets the Gunshot Residue (GSR) state for a specific player.
๐ง Parameters
| Name | Type | Description |
|---|---|---|
source | number | The player's server ID. |
state | boolean | true to apply GSR, false to clear it. |
Client Exports
These exports are available on the client-side to interact with the forensic system and player states.
Custom Evidence Integration
Kartik Evidence is designed to be highly extensible. You can add entirely new forensic modules (e.g., shoe prints, plant fibers) without modifying the core files by using the built-in API.