I think it's getting stuck in an infinite loop Scratch that
Might not solve your issue, but you're missing somthing on line 66.
You should use break to break out of a loop.
For example:
Code:
while (the usual stuff here)
{
if (condition matches)
{
// Escape the loop
break;
}
}
In contrast, if you want to skip an iteration (a cycle in a loop), use continue instead of break.
Also, instead of MAXPLAYERS+1, use MaxClients (SourceMod 1.1.0+) or GetMaxClients() (SourceMod 1.0.4 and older) for your loops. Don't change it in your array declaration on line 12 though - that one's perfectly fine.
Another problem is that while the player is turned invisible -or close to it anyway-, his weapons (which are separate entities) are not. The effect of this is a floating gun, which exposes his position right away.