description |
---|
Allows sending nearest postal to the CAD via the location field. Also enables postal auto-fill for new dispatches and calls. |
{% hint style="warning" %} This plugin utilizes API endpoints that require the standard version of Sonoran CAD or higher. For more information, view our pricing page. {% endhint %}
{% hint style="success" %} Looking for VPS, web, or dedicated hosting? Check out our official server hosting! {% endhint %}
Click to view our locations and postal install video.
If you haven't already, be sure to install and configure the SonoranCAD Core first.
Follow the submodule activation guide for the required submodules.
- If you're using the publicly available nearest-postal script, you will need to follow the steps in the usage section below.
- 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.
- If you're using an event triggered by a custom postals script, you must configure it as explained in the usage section below.
{% hint style="danger" %} 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. {% endhint %}
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. |
Using Nearest-Postal
{% hint style="warning" %} The plugin only supports 1.5.0 or higher of the nearest-postal plugin. Be sure to download the latest version before using. {% endhint %}
If you're using the publicly available nearest-postal script, some minor configuration is required.
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
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.
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'
}
{% hint style="danger" %}
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!
{% endhint %}
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.
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.