AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   Chat-TimeStamps (https://forums.alliedmods.net/showthread.php?t=308203)

mug1wara 06-10-2018 09:21

Chat-TimeStamps
 
1 Attachment(s)
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 :)


https://i.gyazo.com/33931b47293ae089...a4f09e94f4.png

KlausLaw 06-10-2018 09:39

Re: Chat-TimeStamps
 
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;
}


mug1wara 06-10-2018 09:40

Re: Chat-TimeStamps
 
Quote:

Originally Posted by KlausLaw (Post 2596235)
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 ^^

KlausLaw 06-10-2018 10:03

Re: Chat-TimeStamps
 
Quote:

Originally Posted by mug1wara (Post 2596236)
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.

mug1wara 06-10-2018 10:10

Re: Chat-TimeStamps
 
That's fine. I accept constructive criticism. *unecessary*

alex123pavlov 06-16-2018 08:07

Re: Chat-TimeStamps
 
Can be done for CS:Source ?

mug1wara 06-16-2018 10:07

Re: Chat-TimeStamps
 
Quote:

Originally Posted by alex123pavlov (Post 2597243)
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); 


alex123pavlov 06-16-2018 16:38

Re: Chat-TimeStamps
 
Quote:

Originally Posted by mug1wara (Post 2597258)
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

mug1wara 06-16-2018 19:09

Re: Chat-TimeStamps
 
*Missunderstood* I have no idea how to do it for css, might wanna check out amxmodx forum and make a request.

Allower 07-10-2018 15:34

Re: Chat-TimeStamps
 
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!


All times are GMT -4. The time now is 01:52.

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