GET_TIMECYCLE_VAR_DEFAULT_VALUE_BY_INDEX
Signature
float GET_TIMECYCLE_VAR_DEFAULT_VALUE_BY_INDEX(int varIndex);Parameters
| Name | Type | Description |
|---|---|---|
varIndex | int | The index of variable. |
Returns float — The default value of a timecycle variable.
Description
Usage
local retval = GetTimecycleVarDefaultValueByIndex(varIndex)
-- always works, by hash
local retval = Citizen.InvokeNative(0x3b90238, varIndex, Citizen.ResultAsFloat())JavaScript and C#
const retval = GetTimecycleVarDefaultValueByIndex(varIndex);
// by hash
const retval = Citizen.invokeNative('0x3b90238', varIndex, Citizen.returnResultAnyway(), Citizen.resultAsFloat());float retval = Function.Call<float>((Hash)0x3b90238, varIndex);Examples
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
endSources
Something wrong or missing? Contribute a verified note — corrections ship through pull requests.