Postals

Allows sending nearest postal to the CAD via the location field. Also enables postal auto-fill for new dispatches and calls.

This plugin utilizes API endpoints that require the standard version of Sonoran CAD or higher. For more information, view our pricing page.

Looking for VPS, web, or dedicated hosting? Check out our official server hosting!

Activation Video

Click to view our locations and postal install video.

Activation Guide

1. Download and Install the Core

If you haven't already, be sure to install and configure the SonoranCAD Core first.

2. Activate the Submodule and all Dependencies

Follow the submodule activation guide for the required submodules.

3. Configure Postal Script and Exports

  1. If you're using the publicly available nearest-postal script, you will need to follow the steps in the usage section below.

  2. If you're using a custom postal codes file, you will need to add the file to the plugin and Sonoran CAD's fxmanifest as shown in the usage section below.

  3. If you're using an event triggered by a custom postals script, you must configure it as explained in the usage section below.

nearestPostalResourceName should ONLY be filled out if you're using our specific nearest postal script. In other words, do not put the name of your HUD script here, as that will not work.

Configuration

Option
Description
Default

sendTimer

Time between sending postal updates to the server.

950 ms

shouldSendPostalData

Toggles the plugin on/off

True

nearestPostalResourceName

If using our nearest-postal script, specify the name of its folder here

nearest-postal

mode

Specify what "mode" this plugin should use to determine postals. If using nearest-postal, set this to resource. If using an event fired by another resource, set this to event. If using a custom postals file, set this to file.

resource

nearestPostalEvent

If you've set mode to event, specify the name of the event fired by your postals resource here

customPostalCodesFile

If you've set mode to file, copy your custom postal codes file to the postals plugin folder, and add the name of that file here.

Usage

The plugin only supports 1.5.0 or higher of the nearest-postal plugin. Be sure to download the latest version before using.

If you're using the publicly available nearest-postal script, some minor configuration is required.

1. Set the Resource Name

In the Sonoran CAD postals plugin config, change the nearestPostalsResourceName value to the exact name of your nearest postals resource. Ex: nearest-postals-1.5

2. Ensure Proper Startup Order

Be sure that you are starting the nearest-postals addon/resource before/above where you ensure sonorancad in your server.cfg.

Be sure to restart both the Sonoran CAD resource and the nearest-postal script, or restart your server entirely to apply the changes made.

Custom Postal Codes File

If you want to use your own custom postal codes file with this plugin, open the config and change mode to file. Next, copy your custom postal codes file to the postals submodule folder, and set the value of customPostalCodesFile to the name of this file.

Finally, open the fxmanifest.lua file for Sonoran CAD, and change the files { } section at the bottom to look like this, replacing postals_file.json with the name of your postal file:

files {
'stream/**/*.ytyp',
'core/client_nui/index.html',
'core/client_nui/js/*.js',
'core/client_nui/sounds/*.mp3',
'core/client_nui/img/logo.gif',
'submodules/postals/postals_file.json'
}

Do not simply replace the files { } section with that and be done. It is crucial that you change postals_file.json to match the name of your custom postals file!

Custom Postal Events

If you're not using the nearest-postal script or a custom postal codes file, you will need to create a export in your postals script, and have it return the player's current postal as a string.

Additionally, you will need to edit the config to set mode to event, then specify the name of this event in nearestPostalEvent.

Need help? You can always hire a developer.

Troubleshooting

The configured postals file (postals_file.json) was not found

This error may be seen by users attempting to set up the plugin to use a custom postal codes file. Specifically, the error will look something like this, substituting postals_file.json for whatever you've named your custom postal codes file to:

The configured postals file (postals_file.json) was not found. Please check it.

This means that either the postal codes file has not been correctly added to the fxmanifest, or that it has not been added at all. Please reference the above instructions on how to do so.

We recommend replacing the files { } section of your fxmanifest with the given code snippet, then changing postals_file.json to match the name of whatever postals file you're using.

If you've manually entered the line, verify that all the lines in the section except for the last are followed with a comma to ensure that the system can properly read it.

Last updated