Struct GlobalVariable
A value class which handles access to global script variables.
Inherited Members
Namespace: GTA.Native
Assembly: ScriptHookVDotNet3.dll
Syntax
public struct GlobalVariable
Properties
| Improve this Doc View SourceMemoryAddress
Gets the native memory address of the GlobalVariable.
Declaration
public readonly IntPtr MemoryAddress { get; }
Property Value
Type | Description |
---|---|
IntPtr |
Methods
| Improve this Doc View SourceClearBit(Int32)
Set the value of a specific bit of the GlobalVariable to false.
Declaration
public void ClearBit(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero indexed bit of the GlobalVariable to clear. |
Get(Int32)
Gets the global variable at the specified index.
Declaration
public static GlobalVariable Get(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index of the global variable. |
Returns
Type | Description |
---|---|
GlobalVariable | A GlobalVariable instance representing the global variable. |
GetArray(Int32)
Returns an array of all GlobalVariables in a global array.
Declaration
public GlobalVariable[] GetArray(int itemSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | itemSize | The number of items stored in each array index. For example an array of Vector3s takes up 3 items. |
Returns
Type | Description |
---|---|
GlobalVariable[] | The array of GlobalVariables. |
GetArrayItem(Int32, Int32)
Gets the GlobalVariable stored at a specific index in a global array.
Declaration
public GlobalVariable GetArrayItem(int index, int itemSize)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The array index. |
Int32 | itemSize | The number of items stored in each array index. For example an array of Vector3s takes up 3 items. |
Returns
Type | Description |
---|---|
GlobalVariable | The GlobalVariable at the index given. |
GetStructField(Int32)
Gets the GlobalVariable stored at a given offset in a global structure.
Declaration
public GlobalVariable GetStructField(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The index the GlobalVariable is stored in the structure. For example the Y component of a Vector3 is at index 1. |
Returns
Type | Description |
---|---|
GlobalVariable | The GlobalVariable at the index given. |
IsBitSet(Int32)
Gets a value indicating whether a specific bit of the GlobalVariable is set.
Declaration
public bool IsBitSet(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero indexed bit of the GlobalVariable to check. |
Returns
Type | Description |
---|---|
Boolean |
Read<T>()
Gets the value stored in the GlobalVariable.
Declaration
public T Read<T>()
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |
SetBit(Int32)
Set the value of a specific bit of the GlobalVariable to true.
Declaration
public void SetBit(int index)
Parameters
Type | Name | Description |
---|---|---|
Int32 | index | The zero indexed bit of the GlobalVariable to set. |
Write<T>(T)
Set the value stored in the GlobalVariable.
Declaration
public void Write<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The new value to assign to the GlobalVariable. |
Type Parameters
Name | Description |
---|---|
T |
WriteString(String, Int32)
Set the value stored in the GlobalVariable to a string.
Declaration
public void WriteString(string value, int maxSize)
Parameters
Type | Name | Description |
---|---|---|
String | value | The string to set the GlobalVariable to. |
Int32 | maxSize | The maximum size of the string. Can be found for a given global variable by checking the decompiled scripts from the game. |