Lua API reference
Resources interact with the game only through the dlmp table and the handles its functions return. This reference is generated from resources/.types/dlmp.lua, the same type stub that provides completion and type checking in editors, so the two always match.
- The dlmp table pages group the functions by topic, from Resources to Vehicles, together with the option tables they accept.
- Handles are the objects that functions return, such as a
Player, aVehicleor aTimer. A handle's methods act on its element at the time of the call. Some actions also exist as adlmpfunction that takes the handle as its first argument.
Reading an entry
- A parameter marked optional can be omitted or
nil. - Most actions return
boolean|nil ok, string|nil err:trueon success, orniland the reason the server refused. A bug in the script, such as an argument of the wrong type, raises an error instead. See Errors and the sandbox. - Events and their arguments are listed under
dlmp.add_event_handlerand explained in Events, commands and timers.
