Forum

> > Off Topic > Players indicator idea
Forums overviewOff Topic overviewLog in to reply

English Players indicator idea

3 replies
To the start Previous 1 Next To the start

old Players indicator idea

Nem
User Off Offline

Quote
My idea inspired by this:
http://unrealsoftware.de/stats.php
Dont beat me just because its idea and i cant do anything to make it, but i hope you will read it
It would be really useful to make indicator which near tray clock's which will display information 'Users online in ****'
would be really goddamn useful for CC
Is this possible to make btw ?

old Re: Players indicator idea

Nem
User Off Offline

Quote
Thats good to hear. thats the current problem that 1-5 players plays CC every day, maybe less. So i cant tell how awesome would be to see in tray what somebody plays CC and join

old Re: Players indicator idea

Apache uwu
User Off Offline

Quote
Yeah it's completely possible.

This is the current php code I have for displaying the number of CS2D users.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
function get($a,$b,$c){
	$y = explode($b,$a);
	$x = explode($c,$y[1]);
return $x[0];
}
$user=file_get_contents("http://unrealsoftware.de/stats.php");
$user=get($user,'<a href="users.php?p=1">','</a>');
$user="There are currently $user people on cs2d, lets play!"; 
$im = @imagecreate(strlen($user)*9.5,20);
$background_color = imagecolorallocate($im,0,153,0);
$color = imagecolorallocate($im,255,255,255);
imagestring($im,20,10,1,$user,$color);
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
?>

I edited it, it should display the number of CC users.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
function get($a,$b,$c){
	$y = explode($b,$a);
	$x = explode($c,$y[1]);
return $x[0];
}
$user=file_get_contents("http://unrealsoftware.de/stats.php");
$user=get($user,'<a href="users.php?p=2">','</a>');
$user="There are currently $user people on CC, lets play!"; 
$im = @imagecreate(strlen($user)*9.5,20);
$background_color = imagecolorallocate($im,0,153,0);
$color = imagecolorallocate($im,255,255,255);
imagestring($im,20,10,1,$user,$color);
header("Content-Type: image/png");
imagepng($im);
imagedestroy($im);
?>

I changed my for an "example". I do hope CC gets revived--as if it ever died. lol

EDIT: Since CC might get 1, or even 0 players it's good to add a check if it's 0 or 1. So the text can be changed to "There are currently no players on CC" or "There is 1 player on CC", something like that.

This is almost the same as getting the most recent user on usgn--which should be the user viewing the page. Link
To the start Previous 1 Next To the start
Log in to replyOff Topic overviewForums overview