Code | +Description | +
---|
Codes | +Meaning | +
---|
Color Codes | +Meaning | +
---|
${announcement.contents}
` + + function removeHtmlTags(input: string): string { + return input.replace(/<\/?[^>]+(>|$)/g, ""); + } + + return ( +{locales.type} | +{locales.category} | +{locales.done_by} | +{locales.time_ago} | ++ |
---|
{locales.officer} | +{locales.callsign} | +{locales.apu} | +{locales.air} | +{locales.mc} | +{locales.k9} | +{locales.fto} | +{locales.last_active} | +{locales.role} | ++ |
---|
This is a incident description
', + officersInvolved: [ + { + firstname: 'Callum', + lastname: 'Graham', + callsign: 188, + citizenid: '132142', + playerId: 1, + position: [0, 0, 0], + }, + { + firstname: 'Jacob', + lastname: 'Gray', + callsign: 273, + citizenid: '152312', + playerId: 1, + position: [0, 0, 0], + }, + { + firstname: 'Edward', + lastname: 'Atkinson', + callsign: 125, + citizenid: '948213', + playerId: 1, + position: [0, 0, 0], + }, + ], + evidence: [], + criminals: [ + { + firstname: 'Archie', + lastname: 'Moss', + dob: Date.now(), + issueWarrant: false, + processed: false, + pleadedGuilty: false, + citizenid: '0', + charges: [], + penalty: { + time: 0, + fine: 0, + reduction: null, + points: 0, + }, + }, + ], +}; + +const useIncidentStore = createThis is a incident description
', + evidence: [], + officersInvolved: [ + { + firstname: 'Callum', + lastname: 'Graham', + callsign: 188, + citizenid: '132142', + playerId: 1, + position: [0, 0, 0], + }, + { + firstname: 'Jacob', + lastname: 'Gray', + callsign: 273, + citizenid: '152312', + playerId: 1, + position: [0, 0, 0], + }, + { + firstname: 'Edward', + lastname: 'Atkinson', + callsign: 125, + citizenid: '948213', + playerId: 1, + position: [0, 0, 0], + }, + ], + citizensInvolved: [ + { + firstname: 'John', + lastname: 'Doe', + citizenid: 'BUB193Z4A', + dob: Date.now(), + }, + ], +}; + +const useReportStore = create(events: DebugEvent
[], timer = 1000): void => {
+ if (import.meta.env.MODE === 'development' && isEnvBrowser()) {
+ for (const event of events) {
+ setTimeout(() => {
+ window.dispatchEvent(
+ new MessageEvent('message', {
+ data: {
+ action: event.action,
+ data: event.data,
+ },
+ }),
+ );
+ }, timer);
+ }
+ }
+};
\ No newline at end of file
diff --git a/web/src/utils/fetchNui.ts b/web/src/utils/fetchNui.ts
new file mode 100644
index 0000000..081d82e
--- /dev/null
+++ b/web/src/utils/fetchNui.ts
@@ -0,0 +1,37 @@
+/* eslint-disable @typescript-eslint/no-explicit-any */
+/**
+ * Simple wrapper around fetch API tailored for CEF/NUI use. This abstraction
+ * can be extended to include AbortController if needed or if the response isn't
+ * JSON. Tailor it to your needs.
+ *
+ * @param eventName - The endpoint eventname to target
+ * @param data - Data you wish to send in the NUI Callback
+ *
+ * @return returnData - A promise for the data sent back by the NuiCallbacks CB argument
+ */
+
+import { isEnvBrowser } from "./misc";
+
+export async function fetchNui