{"hash":"0x5AE99C571D5BBE5D","ns":"SCRIPT","name":"TRIGGER_SCRIPT_EVENT","slug":"TRIGGER_SCRIPT_EVENT","official":true,"named":true,"luaName":"TriggerScriptEvent","game":"rdr3","apiset":"client","returnType":"void","params":[{"name":"eventGroup","type":"int"},{"name":"eventData","type":"Any*"},{"name":"eventDataSize","type":"int"},{"name":"scriptMetadataIndex","type":"int"},{"name":"playerBits","type":"int*"}],"summary":"playerBits (also known as playersToBroadcastTo) is a bitset that indicates which players this event should be sent to.","descriptions":[{"source":"alloc8or","format":"text","body":"eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)\n\nNote: eventDataSize is NOT the size in bytes, it is the size determined by the SIZE_OF operator (RAGE Script operator, not C/C++ sizeof). That is, the size in bytes divided by 8 (script variables are always 8-byte aligned!).\n\nplayerBits (also known as playersToBroadcastTo) is a bitset that indicates which players this event should be sent to. In order to send the event to specific players only, use (1 << playerIndex). Set all bits if it should be broadcast to all players."}],"examples":[],"aliases":[],"enums":[],"related":[],"build":"1207","gtaHash":"0x5AE99C571D5BBE5D","gtaJhash":"0x54763B35","sources":["alloc8or"],"doc":2,"url":"https://natives.borderlinerp.com/natives/SCRIPT/TRIGGER_SCRIPT_EVENT","markdownUrl":"https://natives.borderlinerp.com/natives/SCRIPT/TRIGGER_SCRIPT_EVENT.md","snippets":{"lua":"local eventData, playerBits = TriggerScriptEvent(eventGroup, eventDataSize, scriptMetadataIndex)","luaInvoke":"local eventData, playerBits = Citizen.InvokeNative(0x5AE99C571D5BBE5D, eventGroup, Citizen.PointerValueInt(), eventDataSize, scriptMetadataIndex, Citizen.PointerValueInt())","js":"const [eventData, playerBits] = TriggerScriptEvent(eventGroup, eventDataSize, scriptMetadataIndex);","jsInvoke":"const [eventData, playerBits] = Citizen.invokeNative('0x5AE99C571D5BBE5D', eventGroup, Citizen.pointerValueInt(), eventDataSize, scriptMetadataIndex, Citizen.pointerValueInt());","csharp":"var eventData = new OutputArgument();\nvar playerBits = new OutputArgument();\nFunction.Call((Hash)0x5AE99C571D5BBE5D, eventGroup, eventData, eventDataSize, scriptMetadataIndex, playerBits);\n// eventData.GetResult<int>()\n// playerBits.GetResult<int>()","notes":["Pointer (out) arguments are not passed in Lua/JS: their values are returned after the result, in order.","`Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below."]}}