- Mar 12, 2005
- 3,249
- 111
- 300
This will make it so you can have a usercount for your server and I have adjusted the script to also show ingame every 10 minutes
You will need a webserver and a php document
This is the code I have within my sig
This saves the number on each refresh to the location at the bottom
Hope this helps, remember the count will only update on refresh's so its not 100% realtime.
You will need a webserver and a php document
This is the code I have within my sig
PHP:
$fp = fsockopen("127.0.0.1", 3000, $errno, $errstr);
if (!$fp) { echo "ERROR: $errno - $errstr<br />\n";} else { fwrite($fp, "\n");
$srvStr = fread($fp, 50);
$srvStr = explode("/", $srvStr);
$srvStr = $srvStr[5];
fclose($fp);
if ($srvStr === false) { $users = "No Users Online"; } else { $srvStr3 = $srvStr . " Players Online";
$srvStr2 = "[Count]\r\nUsersOnline=" . $srvStr;
@file_put_contents('C:\Mud3\Envir\Event\UserCountNumber.txt', $srvStr2); // store the new hit count }
$srvStr = $srvStr[5]; - This can sometimes be different for you.
Change 5 from 1-5 until you get the count
This saves the number on each refresh to the location at the bottom
Inside 00Default add this...
[@main]
#ACT
goto @UserCountEvent
[@UserCountEvent]
#CALL [..\Event\UserCount.txt] @UserCountStart
Create ..\Event\UserCount.txt and add this inside...
[@UserCountStart]
{
#ACT
DELAYGOTO [LOCAL] 300 @UserCountStart1
break
[@UserCountStart1]
#ACT
Loadvalue A1 "Event\UserCountNumber.txt" [Count] [UsersOnline]
lineMsg "Grobal" "Players Currently Online: <$OUTPUT(A1)>"
DELAYGOTO [LOCAL] 300 @UserCountStart ;10 Minute Timer
break
}
Hope this helps, remember the count will only update on refresh's so its not 100% realtime.