Files
YimMenu/docs/lua/classes/scr_value_wrapper.md
T

1.6 KiB

Class: scr_value_wrapper

Class for wrapping arguments and return values of GTA script functions, used by add_script_function_hook.

Functions (6)

get_int()

Get the int value currently contained by the wrapper.

  • Parameters:

    • index (int): The index to access.
  • Returns:

    • int: The current value.

Example Usage:

value = scr_value_wrapper:get_int(0)

set_int()

Set the int value contained by the wrapper.

  • Parameters:
    • index (int): The index to access.
    • value (int): The new value.

Example Usage:

scr_value_wrapper:set_int(0, 42)

get_float()

Get the float value currently contained by the wrapper.

  • Parameters:

    • index (int): The index to access.
  • Returns:

    • float: The current value.

Example Usage:

value = scr_value_wrapper:get_float(0)

set_float()

Set the float value contained by the wrapper.

  • Parameters:
    • index (int): The index to access.
    • value (float): The new value.

Example Usage:

scr_value_wrapper:set_float(0, 3.14)

get_string()

Get the string value currently contained by the wrapper.

  • Parameters:

    • index (int): The index to access.
  • Returns:

    • string: The current value.

Example Usage:

value = scr_value_wrapper:get_string(0)

set_string()

Set the string value contained by the wrapper.

  • Parameters:
    • index (int): The index to access.
    • value (string): The new value.

Example Usage:

scr_value_wrapper:set_string(0, "hello")