TC ScriptDocumentation

Usage

Open the menu, manage options in game with /gestioncontexte, option fields, action types and the built-in pack.

#Opening the menu

StepAction
1Left Alt (or the key chosen in Settings → Key Bindings → FiveM): the cursor appears
2Right-click a player, ped, vehicle, object or the world
3Pick an option. Backspace closes the menu

Config.OpenMode = 'hold' requires holding the key.

#In-game management: /gestioncontexte

Admins only. Every save is written to the database and applied immediately to all connected players.

Options management panel

TabRole
OptionsCreate, edit, duplicate, delete, enable or not, test the action, capture a target (click an entity: type and model are filled in)
ScriptsHide, rename or reorder options added by other scripts
IntegrationEvery code example to copy; each option also has a Lua code button generating ready-to-paste code
Import / ExportFull JSON (backup, transfer between servers)

#Option fields

FieldRole
typebutton, submenu or separator
parentKey of a submenu
target.typesworld, ped, player, vehicle, object, self (empty = all)
target.modelsNames or hashes; the option only shows on these models
distanceMax player → aimed point distance (0 = unlimited)
requirejobs { name = minGrade }, items { name = qty }, admin, ace, inVehicle, onDuty
action.typeSee below

#Action types

TypeEffectHandler receives
client_eventTriggerEvent(name, ctx, args)(ctx, args)
server_eventTriggerServerEvent(name, ctx, args)(ctx, args) + source
commandExecuteCommand(name args)—
exportexports[res]:fn(ctx, args) client-side(ctx, args)
server_exportexports[res]:fn(src, ctx, args) server-side(src, ctx, args)

#The ctx context

FieldContent
entityTypeTarget type
entityEntity (client-side only)
netIdNetwork id
modelModel
coordsAimed coordinates
serverIdTargeted player (server id)
platePlate (vehicle)
distancePlayer → target distance
Security

server_export is re-validated by the server (option exists, job, items, ACE, distance, model) from the definition in the database, never from what the client sends. Other types run client-side: the script receiving a server_event must check for itself what it allows, as with any network event.

#Built-in option pack

Equivalent to the Vision context menu, enabled by default (Config.Pack). On Vision, actions call the same functions, commands and events as the core and read its staff permissions (contextmenu, dev, devcontextmenu, revive, heal, freeze, warn, kick, ban). On other frameworks only generic options are offered and admin is checked by the server.

TargetOptions
PlayerSearch (hands up), Carry · Staff: admin menu, revive, heal, message, inventory, freeze, warn, kick, ban · Dev: armour
SelfDetach attached object, clean up, combat on/off
VehicleDoors (from inside), tow, trunk · Staff: seat, lock, repair, upgrade, customise, delete, player at the wheel · Dev: drift mode
ObjectProps (duplicate / move / delete) · Staff: copy name / hash / entity / position, duplicate, delete
PedStaff: copy name / hash / entity / position, duplicate, delete
WorldStaff: heal the area, repair the area, place a prop · Dev: copy coordinates, teleport, orbital strike

Orbital strike (world → Dev): 3 s countdown with a red marker on the aimed point (Backspace cancels), then 5 rockets fall from 200 m. Settings: Config.Pack.OrbitalCountdown and Config.Pack.OrbitalDamage. Every strike, deletion, teleport and prop placement is logged in the server console.

Not included (tied to the core's internal systems): sitting on benches, boombox / TV, shared emotes, emote adjustment, job menus (recreate them in /gestioncontexte with a job condition), drug labs.

#Performance

Goal: 0.00 ms idle, ≤ 0.01 ms with the menu open.

  • No thread, loop or timer while the menu is closed.
  • Menu open: ~7 natives per frame; the hover ray runs every 100 ms and is skipped when the cursor does not move; NUI messages are only sent when the target changes.
  • Options are evaluated on open only, never every frame.
  • Vision: the big shared object is loaded once in the background, and staff permissions go through a light callback refreshed at most every 60 s without blocking the menu.

Measure: resmon 1 in game (F8), tc-contextmenu column.

Last updated : 7 November 2026© 2026 TC Script