Skip to content

Server ​

dlmp.set_mode_text ​

Sets the mode the server list and the launcher show for this server, such as "Freeroam / TDM": printable UTF-8 of at most 32 bytes without leading or trailing spaces; otherwise returns nil, err. The last caller owns it until it sets "" or stops. May be called while the script loads.

Parameters

  • text string

Returns ok boolean|nil, err string|nil

dlmp.mode_text ​

The mode text the server reports; "" when no resource has set one.

Returns text string

dlmp.set_server_password ​

Sets the password a new connection must prove it knows, like password in server.toml: up to 64 bytes of text without control characters; otherwise returns nil, err. nil or "" lets everyone in. Connected players stay. The launcher shows a lock from the next query; the password itself cannot be read back. Each new password costs the server one slow key derivation (tens of milliseconds) on the next join, so do not change it every tick.

Parameters

  • password string|nil

Returns ok boolean|nil, err string|nil

dlmp.set_player_list_scope ​

Sets which players the built-in player list shows on every client: "all" (everyone on the server, the default), "world" (the viewer's virtual world, in any interior) or "stream" (the players shown to the viewer). The server filters, so a client never receives the rest. An unknown scope raises a Lua error. Server-wide: the setting persists after the resource stops.

Parameters

  • scope "all"|"world"|"stream"

Returns ok boolean|nil, err string|nil

dlmp.player_list_scope ​

Returns "all"|"world"|"stream"

dlmp.kick_player ​

Same as Player:kick.

Parameters

  • player Player
  • reason (optional) string

Returns ok boolean|nil, err string|nil

DlmpBan ​

Fields

  • ip string
  • reason string
  • seconds_left integer|nil — whole seconds left, nil for a permanent ban

dlmp.ban_ip ​

Bans an IPv4 or IPv6 address for seconds (1..4294967295; nil bans permanently), replacing any existing ban on it, and kicks every player connected from it (player_disconnect reason "kicked"). The server stores bans in bans.toml next to resources, so they survive a restart. A new connection from the address is refused before it gets a player and before player_connecting, and the player sees reason and the time left. reason is printable UTF-8, up to 20 bytes, and may be empty. Each ban covers one address; ranges are not supported. A malformed address raises an error; returns nil, err for a reason or duration out of range, or when the server cannot write the ban file (nothing changes then).

Parameters

  • ip string
  • reason (optional) string
  • seconds (optional) integer

Returns ok boolean|nil, err string|nil

dlmp.ban_player ​

Same as Player:ban.

Parameters

  • player Player
  • reason (optional) string
  • seconds (optional) integer

Returns ok boolean|nil, err string|nil

dlmp.unban_ip ​

Lifts the ban on an address; returns nil, err when it has none (an expired ban counts as none).

Parameters

  • ip string

Returns ok boolean|nil, err string|nil

dlmp.bans ​

Every active ban, by address.

Returns DlmpBan[]

Documentation licensed under CC BY 4.0. DarqlineMP is not affiliated with Rockstar Games or Take-Two Interactive. Grand Theft Auto is a trademark of Take-Two Interactive Software, Inc.