SphereCommunity
online status - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: online status (/Thread-online-status)



online status - Runcuks - 12-07-2014 06:34 AM

whats wrong in there? it should be working but argh..
Code:
[function f_onserver_timer]
DB.CONNECT
serv.allclients ONLINE_STATUS_UOS
serv.log pipipi

[function uos_online_status_new]
ctag0.uos_online_status = 0
serv.allclients uonline_status

[FUNCTION uonline_status]
src.ctag0.uos_online_status += 1

[FUNCTION ONLINE_STATUS_UOS]
serv.allclients uos_online_status_new
db.connect
db.execute "UPDATE `online_status` SET `clients`='<dctag0.uos_online_status>' WHERE `id`='1';"

why he is giving me an error in console like undefinied keyword ctag0.uos_online_status


RE: online status - Extreme - 12-07-2014 07:50 AM

I use @Login and @Logout to send to the database who is online.
I think is the easiest way to do it.

But using your code... I would do this:
[function f_onserver_timer]
db.execute UPDATE online_status SET clients='<serv.clients>' WHERE id='1'


RE: online status - Coruja - 12-07-2014 05:31 PM

lol, why call serv.allclients inside a function that already call serv.allclients, inside another function calling serv.allclients again?

if you just want store the players online value, you can replace all these functions with a simple one inside f_onserver_timer

Code:
[FUNCTION f_onserver_timer]
DB.CONNECT
DB.EXECUTE "UPDATE online_status SET clients='<SERV.CLIENTS>' WHERE id='1'"
DB.CLOSE



RE: online status - Runcuks - 12-07-2014 07:14 PM

ahh, thank you fellas Smile yes this would be the easiest way Smile