Raised This Month: $ Target: $400
 0% 

How to calculate player's online activity ?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
t3hNox
Senior Member
Join Date: Oct 2009
Old 05-12-2012 , 07:53   How to calculate player's online activity ?
Reply With Quote #1

I don't really need anyone to make this plugins for me but since I don't have any code I'm posting in this section.

So I'm looking for an optimal way for calculating an individual player online activity (let's say from 0% to 100% like in Psychostats or HLStatsX, for example). I have already looked for formulas but I haven't found any. If I recall correctly then Psychostats had posted their formulas in their Wiki page but now their website is down.

I'd like someone to suggest me SQL DB layout for this, variables (and some kind of coefficient ?) and the formula itself for calculating online activity.

The main goal of this plugin would be to follow and measure admins' activity, so I need a simple and working solution. Nothing (too) complex.
t3hNox is offline
Bilal Pro
Senior Member
Join Date: Mar 2012
Location: Holland
Old 05-12-2012 , 08:48   Re: How to calculate player's online activity ?
Reply With Quote #2

1. Make a new array,
2. When player disconnect save the array + played time, example: Test[id] += get_user_time(id)
3. Save it in nvault, or ur own saving method
__________________
  • Point System with rank titles for sale [X] [100% private]
  • VIP Menu for sale [X] [100% private]
  • HnS shop more features for sale [X] [100% private]
Contact: Bilalzaandam1234, on steam if you are interested.
Bilal Pro is offline
t3hNox
Senior Member
Join Date: Oct 2009
Old 05-12-2012 , 13:37   Re: How to calculate player's online activity ?
Reply With Quote #3

I think I've found the solution. Lol, it's actually very, very simple.
If anyone is interested:

X - total length of the time interval in which the online activity is measured.
Y - how long a player has played during this time interval.

Formula: (Y / X) * 100 = activity in %.

That's all. I hadn't thought about all that thing with the time intervals in which this activity is calculated and therefore made this topic.

Anyways, this topic can be closed.
t3hNox is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:02.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode