Permanent Props and Peds

Database-backed entities, streaming, admin menus, and server exports

Permanent entities

Envi-Zone-Tool can persist props and peds in the database.

These entities stream in and out by distance.

Relevant config values:

  • Config.PropStreamDistance

  • Config.PedStreamDistance

  • Config.AdminPermanentPropsBrowseMax

  • Config.AdminPermanentPedsBrowseMax

  • Config.AdminPermanentPropsNearbyMax

  • Config.AdminPermanentPedsNearbyMax

  • Config.AdminPermanentPropDefaultModel

  • Config.AdminPermanentPedDefaultModel

Database

Tables:

  • envi_permanent_props

  • envi_permanent_peds

Stored values include resource name, optional owner ID, model, coordinates, heading, and JSON metadata.

The server loads rows on boot and keeps clients in sync after CRUD changes.

Admin menus

The admin menus are prop_admin and ped_admin.

When permitted, staff can:

  • browse all entries

  • browse nearby entries

  • teleport

  • set a waypoint

  • copy IDs and transforms

  • re-place entries

  • delete entries

  • place new entries from default models

Client-side permanent entity exports

Props:

  • LoadPermanentProps(resourceName?, ownerId?)

  • RefreshPermanentProps(resourceName?, ownerId?)

  • SubscribeToPermanentProps(resourceName, ownerId?)

  • GetPropSubscriptions()

  • GetAllPermanentPropsData()

  • GetSpawnedPermanentProps()

  • ForceStreamingUpdate()

  • SetStreamDistance(distance)

Peds:

  • LoadPermanentPeds()

  • RefreshPermanentPeds()

  • SubscribeToPermanentPeds()

  • GetPedSubscriptions()

  • GetAllPermanentPedsData()

  • GetSpawnedPermanentPeds()

  • ForcePedStreamingUpdate()

  • SetPedStreamDistance(distance)

Server exports

Permanent prop exports include:

  • GetAllPermanentProps()

  • GetPermanentPropsByResource(resourceName)

  • GetPermanentPropsByOwner(resourceName, ownerId)

  • GetPermanentPropById(id)

  • CreatePermanentProp(data)

  • UpdatePermanentProp(id, data)

  • DeletePermanentProp(id)

  • DeletePermanentPropsByOwner(resourceName, ownerId)

  • DeletePermanentPropsByResource(resourceName)

  • RegisterPermanentPropOnCreate(resourceName, callback)

  • UnregisterPermanentPropOnCreate(resourceName, callback)

  • NotifyPermanentPropsChanged()

Permanent ped exports follow the same pattern:

  • GetAllPermanentPeds()

  • GetPermanentPedsByResource(resourceName)

  • GetPermanentPedsByOwner(resourceName, ownerId)

  • GetPermanentPedById(id)

  • CreatePermanentPed(data)

  • UpdatePermanentPed(id, data)

  • DeletePermanentPed(id)

  • DeletePermanentPedsByOwner(resourceName, ownerId)

  • DeletePermanentPedsByResource(resourceName)

  • RegisterPermanentPedOnCreate(resourceName, callback)

  • UnregisterPermanentPedOnCreate(resourceName, callback)

  • NotifyPermanentPedsChanged()

Permissions

Server permission exports:

  • CanUseZoneTool(source, commandType)

  • CanManagePermanentProps(source)

  • CanManagePermanentPeds(source)

The default live admin checks usually need editing in server/permissions.lua before production.

Last updated