AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   get user playtime (https://forums.alliedmods.net/showthread.php?t=155517)

reinert 04-23-2011 07:21

get user playtime
 
So I've searched forum and found a method that gets users playtime. But I'm doubting is it correct, because I would like to save time in seconds.

here is method:

PHP Code:

new iPlayedTime[33]; // creating new array

iPlayedTime[id]        = SQL_ReadResult(Query8); // getting the last spent time on server from mysql.

get_user_playtimeid )
{
    return 
iPlayedTime[id] + get_user_time(id)
// so thats the method. 

Does this return me users spent time on server in seconds ?

One guy connected to my server for few seconds, but I found in my phpmyadmin that he was in server for 750seconds.

ProIcons 04-23-2011 07:51

Re: get user playtime
 
Please Show us the plugin you use...

reinert 04-23-2011 08:10

Re: get user playtime
 
Well it's private, it has over thousand of lines, I posted everything what is common with playtime. It's all... Nothing useful more ;(

ProIcons 04-23-2011 08:23

Re: get user playtime
 
And how you want us to know where is the problem by showing to us 5 lines?

if we don't see how the code works...

reinert 04-23-2011 08:25

Re: get user playtime
 
Well the whole plugin has nothing to do with user playtime.

And what you mean by saying ( if we don't see how the code works... ) ? I gave all the code that I'm using to get users play time.

clear ?

ProIcons 04-23-2011 08:42

Re: get user playtime
 
no clear

iPlayedTime[id] = SQL_ReadResult(Query, 8); // getting the last spent time on server from mysql.

There is a code that saving playtime in the MySQL. AND a code that is calculating the time that a USER has stayed on your server. if we don't see what it is saving in the mYSQL how will be able to HELP YOU?

reinert 04-23-2011 08:46

Re: get user playtime
 
I'm saving over 10 items in my mysql, everything works, i'm saving it as get_user_playtime(id). Well I think I've fixed it. The problem was in get_user_time.


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

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