Advanced Documentation
In this documentation you'll find information on integrating your scripts with the Power Grid system from Sonoran.
All events listed here are server side.
Registration Event
This event will be called when a player with admin permissions runs the /link
command to link a system to a new device. The event will include the position and entity id of the device as well as the request ID as parameters. When receiving this information you should send back the data about the object either near/at that location or with that entity ID. See examples below for details.
Below is an example of how registration is done within our Traffic Camera Script:
The entity ID field may be nil if the player does not aim directly at the device. You may want to run a check if you have a device in a small area surrounding the target if the entity ID is nil.
When a power system is disabled an event will be triggered that contains a table of internal script identifiers that map to a table of internal IDs of devices that are affected by the system that was disabled. An example from the Sonoran Traffic Camera script is available below:
The event above and the one below must use the RegisterNetEvent
native, this is to avoid possible issues believed to be caused by resource load order in the server.cfg
When a power system is repaired a similar event will be triggered an example from the same script is below:
Last updated