createIncident
CREATE_INCIDENT0x3F892CAF67444AE7The GTA V native CREATE_INCIDENT of the MISC namespace, as LS:MP client scripts call it: the global function createIncident, in JavaScript and in Lua.
createIncident(
dispatchService: number,
x: number,
y: number,
z: number,
numUnits: number,
radius: number,
p7: any,
p8: any
): [ok: boolean, outIncidentID: number]createIncident(
dispatchService: integer,
x: number,
y: number,
z: number,
numUnits: integer,
radius: number,
p7: any,
p8: any
): boolean, integerUsage
const [ok, outIncidentID] = createIncident(dispatchService, x, y, z, numUnits, radius, p7, p8);local ok, outIncidentID = createIncident(dispatchService, x, y, z, numUnits, radius, p7, p8)Three consecutive numbers can be given as one vector: { x, y, z } (or [x, y, z]) in JavaScript, a Vector3 in Lua.
const [ok, outIncidentID] = createIncident(dispatchService, pos, numUnits, radius, p7, p8);local ok, outIncidentID = createIncident(dispatchService, pos, numUnits, radius, p7, p8)Parameters
| Parameter | Type | JavaScript | Lua |
|---|---|---|---|
dispatchService | int | number | integer |
x | float | number | number |
y | float | number | number |
z | float | number | number |
numUnits | int | number | integer |
radius | float | number | number |
p7 | Any | any | any |
p8 | Any | any | any |
Returns
2 values, in this order: an array in JavaScript, multiple return values in Lua.
| # | Value | Type | JavaScript | Lua | Description |
|---|---|---|---|---|---|
| 1 | ok | BOOL | boolean | boolean | The native’s own return value. |
| 2 | outIncidentID | int | number | integer | output |
Notes
From the community native database. Names are LS:MP’s; samples may be written for C++ or another framework.
As for the 'police' incident, it will call police cars to you, but unlike PedsInCavalcades & Merryweather they won't start shooting at you unless you shoot first or shoot at them. The top 2 however seem to cancel theirselves if there is noone dead around you or a fire. I only figured them out as I found out the 3rd param is definately the amountOfPeople and they called incident 3 in scripts with 4 people (which the firetruck has) and incident 5 with 2 people (which the ambulence has). The 4 param I cant say is radius, but for the pedsInCavalcades and Merryweather R* uses 0.0f and for the top 3 (Emergency Services) they use 3.0f.
Side Note: It seems calling the pedsInCavalcades or Merryweather then removing it seems to break you from calling the EmergencyEvents and I also believe pedsInCavalcades. (The V cavalcades of course not IV).
Side Note 2: I say it breaks as if you call this proper,
if(createIncident) etc it will return false if you do as I said above.
Reference
- Namespace
- Misc MISC
- In the game
BOOL CREATE_INCIDENT(int dispatchService, float x, float y, float z, int numUnits, float radius, int* outIncidentID, Any p7, Any p8)- Hash
0x3F892CAF67444AE7