How do I counter of players online

Get help using Construct 2

Post » Mon Jan 23, 2017 5:28 pm

How make counter on layout which display in game how many players currently is playing in my game?
Last edited by IGDev on Wed Jan 25, 2017 11:18 pm, edited 1 time in total.
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Mon Jan 23, 2017 6:44 pm

Is this using the multiplayer object or something else?
B
47
S
18
G
84
Posts: 2,265
Reputation: 49,784

Post » Tue Jan 24, 2017 1:16 pm

plinkie wrote:Is this using the multiplayer object or something else?



no, this should work even if you have blank layout with online users counter (but maybe multiplayer plugin is needed for this i dont know)
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Wed Jan 25, 2017 11:18 pm

https://www.dropbox.com/s/v2e42h67g3ne1 ... 1.png?dl=0

something like that needed
only variable how many peaple is currently on game/site
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Thu Jan 26, 2017 8:27 am

This will probably require you to update a database value via your preferred backend service host/provider plugin whenever someone logs in or disconnects in your game, and pulling that value onto a web page via php. At least that is what I think would be the most straightforward way to do it. How exactly to do so is beyond me, and probably beyond the scope of these forums. Maybe someone with more experience in those topics may be able to help you though.
Mistakes were made.
B
54
S
28
G
115
Posts: 1,705
Reputation: 65,083

Post » Fri Jan 27, 2017 7:23 pm

maybe anyone know how make this using parse / firebase server?
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Mon Jan 30, 2017 1:36 pm

hi again, im still looking solution i have some clue
i found visit counters
http://www.reliablecounter.com/

(currently im using html div pode to display visit counter
maybe i should use other plugin? )

This counters show only page visit
but its working

I search for online users counter i have many generated code but codes dont work



For example i have that code for online users
<script type="text/javascript" src="//www.licznikonline.pl/cnt/start.php?key=582936461"></script>

or from other site

<div><script charset="UTF-8" src="http://edodatki.pl/code/osoby-online?data%5BWidget%5D%5Bdescription%5D=Os%C3%B3b+online%3A&data%5BWidget%5D%5Burl%5D=czatujemy.pl&data%5BWidget%5D%5Bwidth%5D=120&data%5BWidget%5D%5Bcss%5D=white&data%5BWidget%5D%5Bcolor%5D=%23336699&data%5BWidget%5D%5Bstyle%5D=style_1" type="text/javascript"></script><a href="" title=""></a><a href="http://edodatki.pl/widget/osoby-online" title="Osoby online na stronę">Osoby online na stronę</a></div>

other example

<a href='http://www.counterliczniki.com'>liczniki odwiedzin</a> <script type='text/javascript' src='https://www.counterliczniki.com/auth.php?id=7818c660419c851f4a5e1e914ca5b41211828f72'></script>
<script type="text/javascript" src="https://www.counterliczniki.com/pl/home/counter/255495/t/10"></script>

MAybe its possible to change code type and modify for C2?
maybe you know site with friendly code for C2?


THIS IS WORKING CODE !!!

"<a href='http://www.reliablecounter.com' target='_blank'><img src='http://www.reliablecounter.com/count.php?page=https://igamedeveloper.github.io/chat/&digit=style/plain/30/&reloads=0' alt='' title='' border='0'></a><br /><a href='http://www.fabbly.com' target='_blank' style='font-family: Geneva, Arial; font-size: 11px; color: #330010; text-decoration: none;'></a>"
B
25
S
8
Posts: 219
Reputation: 2,181

Post » Mon Feb 06, 2017 7:51 pm

bump
B
25
S
8
Posts: 219
Reputation: 2,181


Return to How do I....?

Who is online

Users browsing this forum: repkino and 5 guests