# UISTATEMACHINE::UI_STATE_MACHINE_DESTROY_AND_CLEAR

- **Hash:** `0x2738D68D2B4E09E7`
- **Namespace:** UISTATEMACHINE
- **Runtime name (Lua/JS):** `UiStateMachineDestroyAndClear`
- **Side:** client (game native)
- **Name status:** official
- **Documentation:** named only
- **Since game build:** 1207
- **URL:** https://natives.borderlinerp.com/natives/UISTATEMACHINE/UI_STATE_MACHINE_DESTROY_AND_CLEAR

## Signature

```c
void UI_STATE_MACHINE_DESTROY_AND_CLEAR(Any* p0);
```

## Parameters

- `p0` (`Any*`)

## Returns

`void`

## Usage

### Lua

```lua
local p0 = UiStateMachineDestroyAndClear(p0)

-- always available, by hash
local p0 = Citizen.InvokeNative(0x2738D68D2B4E09E7, Citizen.PointerValueIntInitialized(p0))
```

### JavaScript

```js
const p0 = UiStateMachineDestroyAndClear(p0);

// by hash
const p0 = Citizen.invokeNative('0x2738D68D2B4E09E7', Citizen.pointerValueIntInitialized(p0));
```

### C#

```csharp
var p0 = new OutputArgument();
Function.Call((Hash)0x2738D68D2B4E09E7, p0);
// p0.GetResult<int>()
```

- The last argument is an in/out pointer: pass its initial value, and the updated value is returned after the result.
- `Any*` arguments are often structs. Build them with a DataView buffer and pass it with `:Buffer()` — see the examples and notes below.

*Sources: alloc8or RDR3 NativeDB.*
