๐Ÿ“–Exports & Usage

Dynyx Prison includes a set of exports that let developers interact with the system from other scripts. These exports allow jail logic, sentence modification, community service, and UI actions to be t

๐Ÿ–ฅ๏ธ Server Exports

These exports should be used from server-side scripts only.


๐Ÿ”’ AddPrisonerExternally

Jails a player and adds them to the prison system.

exports['dynyx_prison']:AddPrisonerExternally(serverId, sentence, charges, lifer, serviceType, previousSentence, fine, officerSr)

Parameters

  • serverId (number) Playerโ€™s server ID.

  • sentence (number) Sentence length in months.

  • charges (table | string) List or string describing the charges.

  • lifer (boolean) Whether the player is a lifer.

  • serviceType (string) "prison" or "community_service".

  • previousSentence (number, optional) Used for sentence stacking.

  • fine (number, optional) Optional fine to apply.

  • officerSrc (number) Server ID of the officer/player performing the arrest.


๐Ÿ”“ ReleasePrisonerExternally

Releases a prisoner normally or marks them as escaped.

Parameters

  • citizenid (string) Playerโ€™s unique citizen identifier.

  • jailbreak (boolean) true if the player escaped false if released normally.

  • officerSrc (number) Server ID of the officer/player authorizing the release.


โœ๏ธ ModifyPrisonerSentenceExternally

Sets a new sentence time for a prisoner.

Parameters:

  • citizenid (string) โ€“ Playerโ€™s unique identifier

  • newTime (number) โ€“ New sentence time in months


๐Ÿ“… GetRemainingPrisonSentence

Returns the current time remaining for a prisoner.

Returns:

  • (number) Time remaining in months

  • 0 if prisoner not found


๐Ÿงฑ GetPrisonCellData

Returns prisoner's cell data.

Returns:

  • number (number) โ€“ Prisonerโ€™s assigned cell number

  • coords (vector3) โ€“ Prisonerโ€™s cell coordinates


โœ… IsActivePrisoner

This Here you go โ€” same format as your docs, just cleaned up with an accurate description based on the actual function logic.


โœ… IsActivePrisoner

Checks if a player is currently an active prisoner.

Returns true only if the player is jailed and is not escaped and not in community service.

Returns:

  • (boolean) true if the player is actively imprisoned

  • (boolean) false if the player is not jailed, has escaped, or is in community service


circle-info

This directly matches:

  • IsPlayerJailed(citizenid)

  • IsPlayerCommunityService(citizenid)

  • IsPlayerEscaped(citizenid)


โœ… IsPlayerJailed

Checks if a player is currently serving a prison sentence.

Returns:

  • (boolean) true if jailed, false if not


๐Ÿ› ๏ธ IsPlayerCommunityService

Checks if a player is currently serving community service.

Returns:

  • (boolean) true if serving community service, false if not


๐Ÿšจ IsPlayerEscaped

Checks if a player has escaped from prison.

Returns:

  • (boolean) true if escaped, false if not


๐Ÿง‘โ€๐Ÿ’ป Client Exports

These can be used from client-side scripts.


๐Ÿฅ SendPlayerToInfirmary

Sends the player to a random infirmary bed, plays the healing sequence, and optionally revives the player.

Parameters

  • chargePlayer (boolean)

    • true โ†’ Charges the player for treatment (if enabled in config)

    • false โ†’ Free treatment (recommended for death/respawn systems)

Primarily used by ambulance or respawn systems to send incarcerated players who die to the prison infirmary.

๐Ÿ“‹ OpenPrisonManageUI

Opens the prison staff UI to view or manage prisoners.

Requires the player to have a valid staff job.


๐Ÿ”จ OpenPrisonJobsUI

Opens the inmate job selection UI.


๐Ÿ”จ OpenCorrectionsTabletUI

Opens the correctional job tablet UI.


๐Ÿ’ก Tips

  • You can use these in custom commands, MDTs, police scripts, admin menus, or integrated job systems.

  • All server-side exports use live data โ€” no need to restart the script after changes.

Last updated