Raised This Month: $51 Target: $400
 12% 

[ANY]Timespent on server[v1.0]


Post New Thread Reply   
 
Thread Tools Display Modes
Author
RNR
Junior Member
Join Date: Oct 2015
Location: India
Plugin ID:
4884
Plugin Version:
1.0
Plugin Category:
General Purpose
Plugin Game:
Any
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Prints timespent on server when users types /time or !time in chat or sm_time in console
    Old 11-09-2015 , 02:12   [ANY]Timespent on server[v1.0]
    Reply With Quote #1

    Description:

    A simple plugins that prints current session timespent on server by the user to users chat when /time or !time is typed in chat or in console when sm_time is typed in console. Timespent for user resets after user disconnect. Is pretty accurate since I kept a stopwatch by my side to make sure its accurate.

    Prints "Use /time or !time in chat or sm_time in console to see time spent on the server." to chat after 15 seconds after round start.

    CVAR
    • sm_advertise 1
      Enable or disable the advertisement that occur after 15 seconds each new round. 1 for enable and 0 for disable.

    Commands to see timespent:
    /time, !time in chat
    sm_time in console

    To install just put the plugin file in addons\sourcemod\plugins.

    TODO list:
    • Total timespent on the server.

    Screenshot:
    Time spent
    Attached Files
    File Type: sp Get Plugin or Get Source (saytime.sp - 699 views - 2.0 KB)
    File Type: smx saytime.smx (5.9 KB, 186 views)
    __________________
    My Github profile =)

    My Plugins

    Si vis pacem, para bellum

    Last edited by RNR; 11-09-2015 at 10:02. Reason: Added a TODO list
    RNR is offline
    mysty
    Member
    Join Date: Oct 2015
    Location: FUCK OFF
    Old 11-09-2015 , 02:40   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #2

    is it for the current session or total?
    mysty is offline
    RNR
    Junior Member
    Join Date: Oct 2015
    Location: India
    Old 11-09-2015 , 02:48   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #3

    Quote:
    Originally Posted by mysty View Post
    is it for the current session or total?
    Current session on server. Made it for my own server actually =)
    __________________
    My Github profile =)

    My Plugins

    Si vis pacem, para bellum

    Last edited by RNR; 11-09-2015 at 02:50.
    RNR is offline
    Lannister
    Veteran Member
    Join Date: Apr 2015
    Old 11-09-2015 , 09:24   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #4

    Good job!

    It should be a good idea to type !time and get the total time you played on the server, maybe with a TOP or something? that shows the ones that played most? it will be really useful and interesting for some events in your server, or something!

    Keep up the good work
    Lannister is offline
    RNR
    Junior Member
    Join Date: Oct 2015
    Location: India
    Old 11-09-2015 , 09:59   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #5

    Quote:
    Originally Posted by Lannister View Post
    Good job!

    It should be a good idea to type !time and get the total time you played on the server, maybe with a TOP or something? that shows the ones that played most? it will be really useful and interesting for some events in your server, or something!

    Keep up the good work
    I will add that to my TODO list for this plugin. Have to learn a lot before that!
    __________________
    My Github profile =)

    My Plugins

    Si vis pacem, para bellum
    RNR is offline
    Potato Uno
    Veteran Member
    Join Date: Jan 2014
    Location: Atlanta, Georgia
    Old 11-09-2015 , 10:11   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #6

    Using steam ID, when the client disconnects, store their session time in a mysql or sqlite database. Then when they reconnect and ask for overall playtime, do a SELECT SUM(time) query.
    Potato Uno is offline
    RNR
    Junior Member
    Join Date: Oct 2015
    Location: India
    Old 11-09-2015 , 11:20   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #7

    Quote:
    Originally Posted by Potato Uno View Post
    Using steam ID, when the client disconnects, store their session time in a mysql or sqlite database. Then when they reconnect and ask for overall playtime, do a SELECT SUM(time) query.
    Thanks for the advice. Will Start digging the wiki.
    __________________
    My Github profile =)

    My Plugins

    Si vis pacem, para bellum
    RNR is offline
    GreYzZ
    Member
    Join Date: Sep 2015
    Old 11-09-2015 , 13:00   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #8

    Can you add a function for the auto updater?
    https://forums.alliedmods.net/showthread.php?t=169095
    GreYzZ is offline
    RNR
    Junior Member
    Join Date: Oct 2015
    Location: India
    Old 11-09-2015 , 14:04   Re: [ANY]Timespent on server[v1.0]
    Reply With Quote #9

    Quote:
    Originally Posted by GreYzZ View Post
    Can you add a function for the auto updater?
    https://forums.alliedmods.net/showthread.php?t=169095
    Will look into it tomorrow.
    __________________
    My Github profile =)

    My Plugins

    Si vis pacem, para bellum
    RNR 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 23:19.


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