C.Blanquer
Hi everyone!
I started to develop plugins for rFactor, i've downloaded the Internal Plugins examples and i've looked plugins.
I want to send automatic messages each 20 seconds(by example)
My function:
Could someone give me a little help?
Thanks in advance!
I started to develop plugins for rFactor, i've downloaded the Internal Plugins examples and i've looked plugins.
I want to send automatic messages each 20 seconds(by example)
My function:
Code:
bool ExampleInternalsPlugin::RequestCommentary( CommentaryRequestInfo &info )
{
// COMMENT OUT TO ENABLE EXAMPLE
//return( false );
// only if enabled, of course
if( !mEnabled )
return( false );
FILE *fo = fopen( "examplefile.txt", "a" ); //Write a file to see if this function is being called, and it is.
if( fo != NULL )
{
fprintf(fo, "SAMPLE\n");
fclose( fo );
}
// Note: function is called twice per second
// Say green flag event for no particular reason every 20 seconds ...
const float timeMod20 = fmodf( mET, 20.0f );
if( timeMod20 > 19.0f )
{
strcpy( info.mName, "GreenFlag" );
info.mInput1 = 0.0f;
info.mInput2 = 0.0f;
info.mInput3 = 0.0f;
info.mSkipChecks = true;
return( true );
}
return( false );
}
Could someone give me a little help?
Thanks in advance!