I'd like a functionality above but it doesn't seem to be working. I was thinking if that's a feature only in newer versions of Pawn but didn't find anything in logs. It doesn't seem that the expression would be evaluated at the point of function definition either because the value of the variable holding the tag id keeps being zero even you would change the tag of the function argument.
Code:
#include < amxmodx >
public plugin_init( )
{
new No, any: Any, test: Test, test2: Test2;
PrintTag( No );
PrintTag( Any );
PrintTag( Test );
PrintTag( Test2 );
server_print( "No: %i, Any: %i, Test: %i, Test2: %i", tagof( No ), tagof( Any ), tagof( Test ), tagof( Test2 ) );
}
PrintTag( Var, Tag = tagof( Var ) )
{
#pragma unused Var
server_print( "Tag: %i", Tag );
}
/*
Code print:
Tag: 0
Tag: 0
Tag: 0
Tag: 0
No: 0, Any: 2, Test: 13, Test2: 14
*/