btw you could save a lot of code if you use $istok for your if request...
also you can use a scripted version of localinfo or something like a "getmyip" snippet
just an example for your if request:
if (($istok(192 127 10.,$left($ip,3),32)) || (!$ip)) uhm and on connect you don't have to check for $server because it returns always something if you are connected...
try if ($status == connected) but you don't need this in an on connect event *sigh*
hmm... and i'm bored... i'm talking to much =)