So here's a function I've got in a plugin:
DLLEXPORT DWORD Distance2D( float x1, float y1, float x2, float y2 )
{
float dist = sqrt( ( ( x2 - x1 ) * ( x2 - x1 ) ) + ( ( y2 - y1 ) * ( y2 - y1 ) ) );
return DBPFloat( &dist );
}
And here is my string table entry:
18, "2D DISTANCE[%FFFFF%Distance2D"
And for some reason if I try to compile the following code:
Do
CLS
Print 2D Distance( 0.0, 0.0, 10.0, 10.0 )
Loop
The compiler says it can't determine the parameter type of '2D Distance'.
I've already used float for parameters and return types in many other plugin functions and it's worked without a problem; what's wrong? I know I'm probably just missing something very stupid.
EDIT:
Nevermind, it appears that command names can't start with a number. I changed it to Distance 2D( ) and it works like a charm.