SHVDN  v3
An ASI plugin for Grand Theft Auto V, which allows running scripts written in any .NET language in-game. Developed by crosire https://github.com/crosire/scripthookvdotnet/
GTA.Native.GlobalVariable Struct Reference

A value class which handles access to global script variables. More...

Public Member Functions

unsafe T Read< T > ()
 Gets the value stored in the GlobalVariable. More...
 
unsafe void Write< T > (T value)
 Set the value stored in the GlobalVariable. More...
 
unsafe void WriteString (string value, int maxSize)
 Set the value stored in the GlobalVariable to a string. More...
 
unsafe void SetBit (int index)
 Set the value of a specific bit of the GlobalVariable to true. More...
 
unsafe void ClearBit (int index)
 Set the value of a specific bit of the GlobalVariable to false. More...
 
unsafe bool IsBitSet (int index)
 Gets a value indicating whether a specific bit of the GlobalVariable is set. More...
 
unsafe GlobalVariable GetStructField (int index)
 Gets the GlobalVariable stored at a given offset in a global structure. More...
 
unsafe GlobalVariable[] GetArray (int itemSize)
 Returns an array of all GlobalVariables in a global array. More...
 
unsafe GlobalVariable GetArrayItem (int index, int itemSize)
 Gets the GlobalVariable stored at a specific index in a global array. More...
 

Static Public Member Functions

static GlobalVariable Get (int index)
 Gets the global variable at the specified index. More...
 

Properties

IntPtr MemoryAddress [get]
 Gets the native memory address of the GlobalVariable. More...
 

Detailed Description

A value class which handles access to global script variables.

Member Function Documentation

◆ ClearBit()

unsafe void GTA.Native.GlobalVariable.ClearBit ( int  index)

Set the value of a specific bit of the GlobalVariable to false.

Parameters
indexThe zero indexed bit of the GlobalVariable to clear.

◆ Get()

static GlobalVariable GTA.Native.GlobalVariable.Get ( int  index)
static

Gets the global variable at the specified index.

Parameters
indexThe index of the global variable.
Returns
A GlobalVariable instance representing the global variable.

◆ GetArray()

unsafe GlobalVariable [] GTA.Native.GlobalVariable.GetArray ( int  itemSize)

Returns an array of all GlobalVariables in a global array.

Parameters
itemSizeThe number of items stored in each array index. For example an array of Vector3s takes up 3 items.
Returns
The array of GlobalVariables.

◆ GetArrayItem()

unsafe GlobalVariable GTA.Native.GlobalVariable.GetArrayItem ( int  index,
int  itemSize 
)

Gets the GlobalVariable stored at a specific index in a global array.

Parameters
indexThe array index.
itemSizeThe number of items stored in each array index. For example an array of Vector3s takes up 3 items.
Returns
The GlobalVariable at the index given.

◆ GetStructField()

unsafe GlobalVariable GTA.Native.GlobalVariable.GetStructField ( int  index)

Gets the GlobalVariable stored at a given offset in a global structure.

Parameters
indexThe index the GlobalVariable is stored in the structure. For example the Y component of a Vector3 is at index 1.
Returns
The GlobalVariable at the index given.

◆ IsBitSet()

unsafe bool GTA.Native.GlobalVariable.IsBitSet ( int  index)

Gets a value indicating whether a specific bit of the GlobalVariable is set.

Parameters
indexThe zero indexed bit of the GlobalVariable to check.

◆ Read< T >()

unsafe T GTA.Native.GlobalVariable.Read< T > ( )

Gets the value stored in the GlobalVariable.

◆ SetBit()

unsafe void GTA.Native.GlobalVariable.SetBit ( int  index)

Set the value of a specific bit of the GlobalVariable to true.

Parameters
indexThe zero indexed bit of the GlobalVariable to set.

◆ Write< T >()

unsafe void GTA.Native.GlobalVariable.Write< T > ( value)

Set the value stored in the GlobalVariable.

Parameters
valueThe new value to assign to the GlobalVariable.

◆ WriteString()

unsafe void GTA.Native.GlobalVariable.WriteString ( string  value,
int  maxSize 
)

Set the value stored in the GlobalVariable to a string.

Parameters
valueThe string to set the GlobalVariable to.
maxSizeThe maximum size of the string. Can be found for a given global variable by checking the decompiled scripts from the game.

Property Documentation

◆ MemoryAddress

IntPtr GTA.Native.GlobalVariable.MemoryAddress
get

Gets the native memory address of the GlobalVariable.


The documentation for this struct was generated from the following file: