# CFX::GET_TIMECYCLE_VAR_DEFAULT_VALUE_BY_INDEX

- **Hash:** `0x3B90238`
- **Namespace:** CFX
- **Runtime name (Lua/JS):** `GetTimecycleVarDefaultValueByIndex`
- **Side:** client (Cfx runtime native)
- **Name status:** official
- **Documentation:** described with examples
- **URL:** https://natives.borderlinerp.com/natives/CFX/GET_TIMECYCLE_VAR_DEFAULT_VALUE_BY_INDEX

## Signature

```c
float GET_TIMECYCLE_VAR_DEFAULT_VALUE_BY_INDEX(int varIndex);
```

## Parameters

- `varIndex` (`int`) — The index of variable.

## Returns

`float` — The default value of a timecycle variable.

## Description

*Source: Cfx.re native reference*

See [GET_TIMECYCLE_VAR_COUNT](#\_0x838B34D8).

## Usage

### Lua

```lua
local retval = GetTimecycleVarDefaultValueByIndex(varIndex)

-- always available, by hash
local retval = Citizen.InvokeNative(0x3b90238, varIndex, Citizen.ResultAsFloat())
```

### JavaScript

```js
const retval = GetTimecycleVarDefaultValueByIndex(varIndex);

// by hash
const retval = Citizen.invokeNative('0x3b90238', varIndex, Citizen.returnResultAnyway(), Citizen.resultAsFloat());
```

### C#

```csharp
float retval = Function.Call<float>((Hash)0x3b90238, varIndex);
```

## Examples

*Source: Cfx.re native reference*

```lua
local varCount = GetTimecycleVarCount()

if varCount ~= 0 then
  for index = 0, varCount - 1 do
    local varName = GetTimecycleVarNameByIndex(index)
    local varDefault = GetTimecycleVarDefaultValueByIndex(index)

    print(string.format("[%d] %s (%f)", index, varName, varDefault))
  end
end
```

*Sources: Cfx.re native reference.*
