TC ScriptDocumentation

Exports and API

tc-forensic server and client exports with their signatures: evidence, profiles, cases, analyses, camera.

Exports are called with exports['tc-forensic']:Name(...).

No exception risk

Server exports are guarded: on error they return nil / false and never throw an exception into your script.

#Server exports

#Players and rights

SignatureRole
IsAuthorized(src)true if the player has a police job and is on duty
IsPoliceJob(jobName)true if the job is recognised as police (Vision: by the core; elsewhere: Config.Police.jobs)
HasGloves(src)Is the player wearing gloves?

#Traces and evidence

SignatureRole
DropFingerprint(src, coords, surface, extraMeta)Leaves player src's fingerprint (unless gloves). coords: vector3 or {x,y,z} (default: the player's position). Returns the evidence or nil
DropBlood(src, coords)Leaves a blood stain with character src's DNA
CreateEvidence(evType, coords, metadata, reason)Creates evidence. Types: casing, blood, fingerprint, gunpowder, gsr, fragment, bullet_impact. metadata: free table (dnaHash, fpHash, caliber, plate…)
GetEvidence(id)Evidence by number (even collected), decoded metadata
GetCasingsNear(coords, radius)Casings currently on the ground within a radius

#DNA, fingerprints, database

SignatureRole
GetHash(identifier, kind)A character's code. kind: 'dna', 'fp' or 'gsr'
GetProfile(identifier)Profile on file (nil if never registered)
RegisterProfile(identifier, kind, by)Registers a character directly on file (e.g. on incarceration). kind: 'dna', 'fp' or 'both'
RemoveProfile(identifier)Removes a profile
ResolveHash(kind, hash)Resolves a code: { known, registered, person, npc }
IsGsrPositive(identifierOrSrc)Gunshot-residue test without an item: returns positive (bool), number of traces
WashHands(identifierOrSrc)Clears gunshot residue (shower, hand washing…)

#Cases

SignatureRole
CreateCase(data)Creates a case. data = { title, category, priority (1-3), summary, location, coords, lead = src } (lead optional)
GetCase(id)Reads a case
SetCaseStatus(id, status)status: open, active, suspended, solved or closed
AddCaseNote(id, body, authorName, kind)kind: 'note', 'event' or 'system'
AddPersonToCase(id, identifier, role, notes)Attaches a person
AddVehicleToCase(id, plate, notes)Attaches a vehicle
AttachToCase(id, kind, refId, label)kind: 'evidence', 'analysis', 'photo' or 'folder'
GetCasesForPerson(identifier)Cases where a character appears: { id, title, status, role }
GetCasesForPlate(plate)Cases linked to a plate

#Laboratory and photos

SignatureRole
GetAnalysis(id)Analysis (full result when finished)
GetPhotoInfo(id)Photo information, without the image
OpenCamera(src)Opens the camera viewfinder for a player, without checking the item
ShowPhoto(src, photoId)Shows a photo to a player, without giving them the item

#Client exports

SignatureRole
IsAuthorized()Is the local player authorised?
OpenEnquete(tab)Opens the investigation tablet. tab: 'dashboard', 'cases', 'people', 'fichier', 'lab' or 'evidence'
OpenCamera() / CloseCamera()Opens / closes the camera viewfinder
IsCameraActive()Viewfinder state
ViewPhoto(photoId)Shows a photo the player owns or may see
LeaveFingerprint(surface, coords)Leaves the local player's fingerprint (unless gloves): forced safe, till, ATM… coords optional (within 6 m of the player). Returns { ok, id, gloves }

#Examples

server.lua
-- A robbery wounds a player: blood at the scene
exports['tc-forensic']:DropBlood(src, GetEntityCoords(GetPlayerPed(src)))

-- Automatically open a case after a shooting
local id = exports['tc-forensic']:CreateCase({
    title = 'Shooting — Strawberry', category = 'Fusillade', priority = 2,
    summary = 'Gunshots reported.', location = 'Strawberry Ave',
})
exports['tc-forensic']:AddCaseNote(id, 'Case opened automatically.', 'System', 'system')

-- Restrict an action to on-duty police
if not exports['tc-forensic']:IsAuthorized(src) then return end
client.lua
-- A forced safe leaves the burglar's fingerprint
local r = exports['tc-forensic']:LeaveFingerprint('safe')
Last updated : 7 November 2026© 2026 TC Script