Get (GameEvents)

From fantasy.cat - SDK
Jump to: navigation, search
Get

These are a list of functions that allow you to get a value based off of a game event's key.

Syntax

bool GetBool(void * evptr, const char * key)

int GetInteger(void * evptr, const char * key)

long GetLong(void * evptr, const char * key)

const char * GetString(void * evptr, const char * key)

float GetFloat(void* evptr, const char* key)

Required Arguments

evptr: The Event Information Pointer.

key The key found in the event's structure.

Returns

  • The value of the key, matching of the related type.

Example

This example announces in your cheat console who died and what weapon was used.

void on_player_death( void * event_data )
{
    auto dead_player = GetPlayerFromEvent( sdk_information, sdk_event_information, event_data );
    sdk_information->OutputConsole( "%s just died to a %s", dead_player.name, sdk_event_information->GetString( event_data, "weapon") );
}

Notes