DarkRP¶
DarkRP compatibility helpers for Lilia, including spawn position checks, DarkRP-style notifications, currency formatting, entity item generation, command registration adapters, door keyvalue handling, and RPExtraTeams synchronization.
Overview
lia.darkrp.isEmpty(position, entitiesToIgnore)View Source
Purpose
Checks whether a position is clear of solid contents and nearby blocking entities.
Realm
Server
Parameters
Vector position The world position to check.
table entitiesToIgnore optional Optional list of entities that should not cause the position to be considered occupied.
Returns
boolean True if the position is clear, false otherwise.
Example Usage
local position = lia.darkrp.isEmpty(client:GetPos(), {client})
print(position)
lia.darkrp.findEmptyPos(startPos, entitiesToIgnore, maxDistance, searchStep, checkArea)View Source
Purpose
Finds the nearest clear position around a starting point by checking offsets along each axis.
Realm
Server
Parameters
Vector startPos The preferred world position.
table entitiesToIgnore optional Optional list of entities ignored by the occupancy checks.
number maxDistance The maximum distance from the starting position to search.
number searchStep The distance increment used while searching outward.
Vector checkArea Additional offset checked from each candidate position to confirm clearance.
Returns
Vector The first clear position found, or the starting position if no clear offset is found.
Example Usage
local position = lia.darkrp.findEmptyPos(client:GetPos(), {client}, 600, 30, Vector(0, 0, 72))
client:SetPos(position)
lia.darkrp.notify(client, notifyType, duration, message)View Source
Purpose
Sends a DarkRP-compatible notification through Lilia's localized notification system.
Realm
Server
Parameters
Player client The player receiving the notification.
number|string notifyType optional DarkRP notification type value accepted for compatibility but not used by this shim.
number duration optional DarkRP notification duration accepted for compatibility but not used by this shim.
string message The localization key or message passed to the notification system.
Example Usage
lia.darkrp.notify(client, 0, 4, "someLocalizationKey")
lia.darkrp.textWrap(text, fontName, maxLineWidth)View Source
Purpose
Wraps text to fit within a maximum pixel width using Garry's Mod surface font measurements.
Realm
Client
Parameters
string text The text to wrap.
string fontName The surface font used to measure the text.
number maxLineWidth The maximum line width in pixels.
Returns
string The wrapped text with newline breaks inserted where needed.
Example Usage
local text = lia.darkrp.textWrap("Long text", "DermaDefault", 200)
print(text)
lia.darkrp.formatMoney(amount)View Source
lia.darkrp.createEntity(name, data)View Source
lia.darkrp.createCategory()View Source
Hooks
Library-specific hooks documented for this library.