scripts

Methods

_set_player_bit_at_index

function native.scripts._set_player_bit_at_index(value: ptr int, bit_index: int): void

_clear_player_bit_at_index

function native.scripts._clear_player_bit_at_index(value: ptr int, bit_index: int): void

_0xe4abe20dce7c7cfe

function native.scripts._0xe4abe20dce7c7cfe(p0: int, p1: int, p2: int): void

_0xffddf802279be128

function native.scripts._0xffddf802279be128(p0: int, p1: int, p2: int): void

_0x64f765d9a1f8f02c

function native.scripts._0x64f765d9a1f8f02c(p0: ptr int, p1: ptr int, p2: ptr int): void

_set_all_player_bits

function native.scripts._set_all_player_bits(value: ptr int): void

_clear_all_player_bits

function native.scripts._clear_all_player_bits(value: ptr int): void

_is_player_bit_set_at_index

function native.scripts._is_player_bit_set_at_index(value: ptr int, bit_index: int): bool

_is_any_player_bit_set

function native.scripts._is_any_player_bit_set(player_bits: ptr int): bool

get_block_of_player_bits

function native.scripts.get_block_of_player_bits(value: ptr int, p1: int): int

set_block_of_player_bits

function native.scripts.set_block_of_player_bits(value: ptr int, p1: int, p2: int): void

count_player_bits

function native.scripts.count_player_bits(value: ptr int): int

_0x1bdb5a07307f6929

function native.scripts._0x1bdb5a07307f6929(p0: int, p1: int): void

_0x1c5eb3c27f7508cb

function native.scripts._0x1c5eb3c27f7508cb(p0: int, p1: int): void

_0x42a429cdfed6d99d

function native.scripts._0x42a429cdfed6d99d(p0: int, p1: int, p2: int): void

_0x5827be85a87b073d

function native.scripts._0x5827be85a87b073d(p0: int): void

_0x0a79c81c418f5d38

function native.scripts._0x0a79c81c418f5d38(p0: int, p1: int): int

_0xa88e1d7fa1e20080

function native.scripts._0xa88e1d7fa1e20080(p0: int): int

count_participant_bits

function native.scripts.count_participant_bits(value: ptr int): int

request_script

function native.scripts.request_script(script_name: string): void

set_script_as_no_longer_needed

function native.scripts.set_script_as_no_longer_needed(script_name: string): void

has_script_loaded

Returns if a script has been loaded into the game. Used to see if a script was loaded after requesting.

function native.scripts.has_script_loaded(script_name: string): bool

does_script_exist

function native.scripts.does_script_exist(script_name: string): bool

request_script_with_name_hash

function native.scripts.request_script_with_name_hash(script_hash: int): void

set_script_with_name_hash_as_no_longer_needed

function native.scripts.set_script_with_name_hash_as_no_longer_needed(script_hash: int): void

has_script_with_name_hash_loaded

function native.scripts.has_script_with_name_hash_loaded(script_hash: int): bool

does_script_with_name_hash_exist

function native.scripts.does_script_with_name_hash_exist(script_hash: int): bool

terminate_thread

function native.scripts.terminate_thread(thread_id: int): void

is_thread_active

function native.scripts.is_thread_active(thread_id: int, ignore_killed_state: bool): bool

does_thread_exist

function native.scripts.does_thread_exist(thread_id: int): bool

get_thread_existence_details

function native.scripts.get_thread_existence_details(thread_id: int, thread_exists: ptr int, has_script_handler: ptr int): void

_get_hash_of_thread

function native.scripts._get_hash_of_thread(thread_id: int): int

script_thread_iterator_reset

Starts a new iteration of the current threads. Call this first, then SCRIPT_THREAD_ITERATOR_GET_NEXT_THREAD_ID (0x30B4FA1C82DD4B9F)

function native.scripts.script_thread_iterator_reset(): void

script_thread_iterator_get_next_thread_id

If the function returns 0, the end of the iteration has been reached.

function native.scripts.script_thread_iterator_get_next_thread_id(): int

_is_background_script

function native.scripts._is_background_script(thread_id: int): bool

get_id_of_this_thread

function native.scripts.get_id_of_this_thread(): int

terminate_this_thread

function native.scripts.terminate_this_thread(): void

get_number_of_threads_running_the_script_with_this_hash

Gets the number of instances of the specified script is currently running.

Actually returns numRefs - 1. if (program) v3 = rage::scrProgram::GetNumRefs(program) - 1; return v3;

Old name: _GET_NUMBER_OF_REFERENCES_OF_SCRIPT_WITH_NAME_HASH

function native.scripts.get_number_of_threads_running_the_script_with_this_hash(script_hash: int): int

_request_thread_exit

function native.scripts._request_thread_exit(thread_id: int): void

_request_thread_exit_for_all_threads_with_this_name

function native.scripts._request_thread_exit_for_all_threads_with_this_name(name_hash: int): void

is_thread_exit_requested

function native.scripts.is_thread_exit_requested(): bool

_is_thread_exit_requested_for_thread_with_this_id

function native.scripts._is_thread_exit_requested_for_thread_with_this_id(thread_id: int): bool

_get_thread_exit_reason

enum eThreadExitReason { THREAD_EXIT_REASON_NONE, THREAD_EXIT_REASON_BACKGROUND_THREAD_STOPPED, THREAD_EXIT_REASON_SESSION_MERGE, THREAD_EXIT_REASON_SCENARIO_OUT_OF_SCOPE, THREAD_EXIT_REASON_REQUESTED_BY_SCRIPT };

function native.scripts._get_thread_exit_reason(): int

get_hash_of_this_script_name

function native.scripts.get_hash_of_this_script_name(): int

get_number_of_events

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_ERRORS (CEventGroupScriptErrors)

function native.scripts.get_number_of_events(event_group: int): int

get_event_exists

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

function native.scripts.get_event_exists(event_group: int, event_type: int): bool

get_event_at_index

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

Returns event name hash: https://alloc8or.re/rdr3/doc/enums/eEventType.txt

function native.scripts.get_event_at_index(event_group: int, event_index: int): int

get_event_data

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

Note: 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!).

https://github.com/femga/rdr3_discoveries/tree/master/AI/EVENTS

function native.scripts.get_event_data(event_group: int, event_index: int, event_data: ptr int, event_data_size: int): bool

set_event_flag_for_deletion

function native.scripts.set_event_flag_for_deletion(event_group: int, event_index: int, p2: bool): void

trigger_script_event

eventGroup: 0 = SCRIPT_EVENT_QUEUE_AI (CEventGroupScriptAI), 1 = SCRIPT_EVENT_QUEUE_NETWORK (CEventGroupScriptNetwork), 2 = unk, 3 = unk, 4 = SCRIPT_EVENT_QUEUE_SCRIPT_ERRORS (CEventGroupScriptErrors)

Note: 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!).

playerBits (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.

function native.scripts.trigger_script_event(event_group: int, event_data: ptr int, event_data_size: int, script_metadata_index: int, player_bits: ptr int): void

_trigger_script_event_2

function native.scripts._trigger_script_event_2(event_data: ptr int, event_data_size: int, script_metadata_index: int, thread_id: int): void

_0xe7282390542f570d

function native.scripts._0xe7282390542f570d(p0: int): int

_0x11b0a0b282fa9b10

Used in Script Function DISABLE_REGISTERED_WORLD_BRAINS

function native.scripts._0x11b0a0b282fa9b10(p0: bool): void

_0x6f700a4bf7c3331b

function native.scripts._0x6f700a4bf7c3331b(p0: bool): void

_0xf9e951a1e5517c06

function native.scripts._0xf9e951a1e5517c06(): void

_0x76cbcd9eadc00955

function native.scripts._0x76cbcd9eadc00955(): void

shutdown_loading_screen

function native.scripts.shutdown_loading_screen(): void

set_no_loading_screen

function native.scripts.set_no_loading_screen(toggle: bool): void

get_no_loading_screen

function native.scripts.get_no_loading_screen(): bool

_display_loading_screens

function native.scripts._display_loading_screens(p0: int, p1: int, p2: int, gamemode_name: string, title: string, subtitle: string): void

_0x29fb4ce89472c3cb

function native.scripts._0x29fb4ce89472c3cb(p0: int, p1: int, p2: float, p3: float, p4: string, p5: string, p6: string, p7: int): void

stop_displaying_mp_transition_loading_screens

function native.scripts.stop_displaying_mp_transition_loading_screens(p0: int): void

is_loading_screen_visible

Same as GET_IS_LOADING_SCREEN_ACTIVE

function native.scripts.is_loading_screen_visible(): bool

bail_to_landing_page

function native.scripts.bail_to_landing_page(bail_code: int): void

bail_with_pass_through_params

function native.scripts.bail_with_pass_through_params(params: string): void

bg_is_exitflag_set

Returns true if GtaThread+0x77C is equal to 1.

Old name: _BG_EXITED_BECAUSE_BACKGROUND_THREAD_STOPPED

function native.scripts.bg_is_exitflag_set(): bool

bg_set_exitflag_response

Sets bit 0 in GtaThread+0x784

function native.scripts.bg_set_exitflag_response(): void

bg_start_context_hash

Hashed version of BG_START_CONTEXT

function native.scripts.bg_start_context_hash(context_hash: int): void

bg_end_context_hash

Hashed version of BG_END_CONTEXT

function native.scripts.bg_end_context_hash(context_hash: int): void

bg_start_context

Inserts the given context into the background scripts context map.

function native.scripts.bg_start_context(context_name: string): void

bg_end_context

Deletes the given context from the background scripts context map.

function native.scripts.bg_end_context(context_name: string): void

bg_does_launch_param_exist

function native.scripts.bg_does_launch_param_exist(script_index: int, p1: string): bool

bg_get_launch_param_value

function native.scripts.bg_get_launch_param_value(script_index: int, p1: string): int

bg_get_script_id_from_name_hash

function native.scripts.bg_get_script_id_from_name_hash(p0: int): int

_bg_reload_all_background_scripts

function native.scripts._bg_reload_all_background_scripts(): void

_activate_goal_context

goalContext: see in common/data/stats_and_challenges/goals_*.meta

function native.scripts._activate_goal_context(goal_context: int): void

_deactivate_goal_context

goalContext: see _ACTIVATE_GOAL_CONTEXT

function native.scripts._deactivate_goal_context(goal_context: int): void

_is_goal_context_active

goalContext: see _ACTIVATE_GOAL_CONTEXT

function native.scripts._is_goal_context_active(goal_context: int): bool

_net_rpc_guid_to_string

Returns "INVALID_NET_RPC_GUID" if netRpcGuid is invalid.

function native.scripts._net_rpc_guid_to_string(net_rpc_guid: ptr int): string

awards_get_result_item

function native.scripts.awards_get_result_item(rpc_guid: ptr int, award_hash: int, item_index: int, out_result_item: ptr int): bool

_awards_get_unlock_claim_data

function native.scripts._awards_get_unlock_claim_data(rpc_guid: ptr int, award_hash: int, data_index: int, out_unlock_data: ptr int): bool

_loot_get_result_item

function native.scripts._loot_get_result_item(rpc_guid: ptr int, item_index: int, out_result_item: ptr int): bool

_loot_get_loot_claim_data

function native.scripts._loot_get_loot_claim_data(rpc_guid: ptr int, data_index: int, out_loot_data: ptr int): bool

_store_global_block

function native.scripts._store_global_block(index: int): bool

_restore_global_block

function native.scripts._restore_global_block(index: int): bool

_does_compressed_global_block_buffer_exist

function native.scripts._does_compressed_global_block_buffer_exist(index: int): bool

_set_global_block_can_be_accessed

function native.scripts._set_global_block_can_be_accessed(index: int, toggle: bool): void

_get_global_block_can_be_accessed

function native.scripts._get_global_block_can_be_accessed(index: int): bool

_set_all_global_blocks_have_been_loaded

function native.scripts._set_all_global_blocks_have_been_loaded(toggle: bool): void

have_all_child_scripts_terminated

Waiting for child scripts to terminate / waiting for collapse of child scripts

function native.scripts.have_all_child_scripts_terminated(p0: int): bool

start_new_script

function native.scripts.start_new_script(script_name: string, stack_size: int): int

start_new_script_with_args

return : script thread id, 0 if failed Pass pointer to struct of args in p1, size of struct goes into p2

function native.scripts.start_new_script_with_args(script_name: string, args: ptr int, arg_count: int, stack_size: int): int

start_new_script_with_name_hash

function native.scripts.start_new_script_with_name_hash(script_hash: int, stack_size: int): int

start_new_script_with_name_hash_and_args

function native.scripts.start_new_script_with_name_hash_and_args(script_hash: int, args: ptr int, arg_count: int, stack_size: int): int