Why are you pre incrementing the variable i.
I can't remember if the 0 id is being Skipped but other than that everything seems fine.
Also luna declaration of a static variable with a starting constant value is valid.
So this is valid!
PHP Code:
static pluginid = -1;
Also for the OP Try using server_print instead of log_amx and see if the thing is outputted, but make sure to call the function more than once.
__________________