Raised This Month: $35 Target: $400
 8% 

Chat-TimeStamps


Post New Thread Reply   
 
Thread Tools Display Modes
Author
mug1wara
AlliedModders Donor
Join Date: Jun 2018
Location: Not your business.
Plugin ID:
6159
Plugin Version:
1.0.2
Plugin Category:
General Purpose
Plugin Game:
Counter-Strike: GO
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Provides timestamp prefixes in chat.
    Old 06-10-2018 , 10:21   Chat-TimeStamps
    Reply With Quote #1

    Chat-TimeStamps
    Discord: Mugiwara#2249

    This is a plugin that provides timestamp prefixes in chat. Thanks to the unixtime_sourcemod include, we're allowed to do some fun stuff as what you see in this plugin. !cts, opens a menu with a bunch of names, those names are timezones. Select your desired timezone, type something in chat and you will never miss your favourite episode of One Piece, since you can see the clock while playing a game of Counter-Strike.

    The selected timezone is saved, no need to select one over and over again ^^
    (default is the server's timezone).

    You will need this include to compile the plugin. Also feel free to do any changes, let me know if I did something retarded, thank you.

    Changelog:
    Code:
    v.1.0.2 - Added time to scoreboard, aswell as cvar for enabling / disabling it.
    
    v.1.0.1 - Added Client Cookies, selected timezones saved.
    
    v.1.0.0 - Release.
    Special thanks to Kailo, who helped me looping through teams (don't judge me, I'm a noob coder).

    Have fun with the plugin


    Attached Files
    File Type: zip Chat-TimeStamps.zip (11.2 KB, 85 views)
    __________________
    Taking requests, add me on Steam.

    People make themselves understood in a way, others understand in another.

    Last edited by mug1wara; 06-10-2018 at 12:13.
    mug1wara is offline
    KlausLaw
    AlliedModders Donor
    Join Date: Feb 2018
    Location: Israel
    Old 06-10-2018 , 10:39   Re: Chat-TimeStamps
    Reply With Quote #2

    Why don't you use scp, and do something like this:
    Code:
    public Action OnChatMessage(int &client, Handle recipients, char[] sName, char[] sMessage)
    {
    	char sTime[16];
    	FormatTime(sTime, sizeof(sTime), "%H:%M", GetTime());
    	Format(sName, MAX_NAME_LENGTH, " \x04%s\x03 - %N", sTime, client);
    	return Plugin_Changed;
    }
    __________________
    Taking private requests.


    Last edited by KlausLaw; 06-10-2018 at 11:08.
    KlausLaw is offline
    mug1wara
    AlliedModders Donor
    Join Date: Jun 2018
    Location: Not your business.
    Old 06-10-2018 , 10:40   Re: Chat-TimeStamps
    Reply With Quote #3

    Quote:
    Originally Posted by KlausLaw View Post
    Why don't you use scp.
    I allowed players to change their timezones. Then I have to do it a bit differently, that's why ^^
    __________________
    Taking requests, add me on Steam.

    People make themselves understood in a way, others understand in another.
    mug1wara is offline
    KlausLaw
    AlliedModders Donor
    Join Date: Feb 2018
    Location: Israel
    Old 06-10-2018 , 11:03   Re: Chat-TimeStamps
    Reply With Quote #4

    Quote:
    Originally Posted by mug1wara View Post
    I allowed players to change their timezones. Then I have to do it a bit differently, that's why ^^
    You still could have done it way more better.
    What i wrote, does the same thing without the ability to change the time zone, in 5 lines.

    I'm telling you this just so you could learn from that and get better.
    __________________
    Taking private requests.

    KlausLaw is offline
    mug1wara
    AlliedModders Donor
    Join Date: Jun 2018
    Location: Not your business.
    Old 06-10-2018 , 11:10   Re: Chat-TimeStamps
    Reply With Quote #5

    That's fine. I accept constructive criticism. *unecessary*
    __________________
    Taking requests, add me on Steam.

    People make themselves understood in a way, others understand in another.

    Last edited by mug1wara; 06-10-2018 at 11:37.
    mug1wara is offline
    alex123pavlov
    Member
    Join Date: Jun 2018
    Old 06-16-2018 , 09:07   Re: Chat-TimeStamps
    Reply With Quote #6

    Can be done for CS:Source ?
    alex123pavlov is offline
    mug1wara
    AlliedModders Donor
    Join Date: Jun 2018
    Location: Not your business.
    Old 06-16-2018 , 11:07   Re: Chat-TimeStamps
    Reply With Quote #7

    Quote:
    Originally Posted by alex123pavlov View Post
    Can be done for CS:Source ?
    Yes indeed, it can be done! There's an easier way in sourcemod, don't know if it works for css though. Try it:
    PHP Code:
    char szTime[16];

    int iTime GetTime();

    FormatTime(szTimesizeof(szTime), "%H:%M"iTime);

    PrintToChatAll("The time is %s"szTime); 
    __________________
    Taking requests, add me on Steam.

    People make themselves understood in a way, others understand in another.
    mug1wara is offline
    alex123pavlov
    Member
    Join Date: Jun 2018
    Old 06-16-2018 , 17:38   Re: Chat-TimeStamps
    Reply With Quote #8

    Quote:
    Originally Posted by mug1wara View Post
    Yes indeed, it can be done! There's an easier way in sourcemod, don't know if it works for css though. Try it:
    PHP Code:
    char szTime[16];

    int iTime GetTime();

    FormatTime(szTimesizeof(szTime), "%H:%M"iTime);

    PrintToChatAll("The time is %s"szTime); 
    what exactly to replace?
    -
    "v.1.0.2 - Added time to scoreboard, aswell as cvar for enabling / disabling it." does not work in cssource

    Last edited by alex123pavlov; 06-16-2018 at 17:50.
    alex123pavlov is offline
    mug1wara
    AlliedModders Donor
    Join Date: Jun 2018
    Location: Not your business.
    Old 06-16-2018 , 20:09   Re: Chat-TimeStamps
    Reply With Quote #9

    *Missunderstood* I have no idea how to do it for css, might wanna check out amxmodx forum and make a request.
    __________________
    Taking requests, add me on Steam.

    People make themselves understood in a way, others understand in another.

    Last edited by mug1wara; 06-17-2018 at 07:34.
    mug1wara is offline
    Allower
    Member
    Join Date: Sep 2013
    Location: SourceEngine
    Old 07-10-2018 , 16:34   Re: Chat-TimeStamps
    Reply With Quote #10

    If i use this with CCC, so does this strip chat tags used by CCC, or work together?

    Like this:
    Code:
    12:34 - «Admin» Allower: Hello, world!
    __________________
    Allower is offline
    Reply


    Thread Tools
    Display Modes

    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 15:52.


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