Had the same problem with the example code (ie no data)...
This is what I'm using with no problems...
Code:
#define VNAME "EMPTY"
// Data type
enum types_t
{
TYPE_NONE = 0,
TYPE_STRING,
TYPE_INT,
TYPE_FLOAT,
TYPE_PTR,
TYPE_WSTRING,
TYPE_COLOR,
TYPE_NUMTYPES,
};
void CMembersServerPlugin::FireGameEvent( KeyValues * event )
{
const char * name = event->GetName();
Msg( "[%s] DEBUG: CMPS::FireGameEvent: Got event \"%s\"\n", VNAME, name );
Msg( "( " );
for( KeyValues *pKey = event->GetFirstSubKey(); pKey; pKey = pKey->GetNextKey() )
{
switch( pKey->GetDataType() )
{
case TYPE_STRING:
Msg( "\"%s\" \"%s\"; ", pKey->GetName(), pKey->GetString() );
break;
case TYPE_INT:
Msg( "\"%s\" %d; ", pKey->GetName(), pKey->GetInt() );
break;
case TYPE_FLOAT:
Msg( "\"%s\" %f; ", pKey->GetName(), pKey->GetFloat() );
break;
default:
Msg( "\"%s\" <#%d>; ", pKey->GetName(), pKey->GetDataType() );
break;
}
}
Msg( ")\n" );
}