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

[REQ] log player command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
supreeda
Senior Member
Join Date: Jul 2015
Old 12-12-2015 , 14:38   [REQ] log player command
Reply With Quote #1

Hello guys Please someone Give me a link if it done already or make this for me

I want show on log folder Player.txt or something for when client use !dice or anything client use

it will show NAME and what command he use , Time for sure !

Thank
supreeda is offline
ThatOneGuy
Veteran Member
Join Date: Jul 2012
Location: Oregon, USA
Old 12-13-2015 , 23:14   Re: [REQ] log player command
Reply With Quote #2

Quote:
Originally Posted by supreeda View Post
Hello guys Please someone Give me a link if it done already or make this for me

I want show on log folder Player.txt or something for when client use !dice or anything client use

it will show NAME and what command he use , Time for sure !

Thank
Spoiler


Normally, you would want to use IsChatTrigger(), but so many plugins dont register commands, but use chat instead, that you are left with checking chat to catch those. Plugins that use non-registered commands and dont start with ! or /, you will need to code in exceptions for (e.g. "bet ct all").

Basically, the above code will log ALL chat that starts with ! or /, whether or not it shows up in chat (i.e. if it is silent), and whether or not it is actually a command (i.e. someone can type "!hahaha im filling up your server logs", and it will log it. This is needed in order to catch all of the non-registered commands).

Might I suggest though, adding in the date and some code to make it make new files each day? Else you will end up with a giant log. Additionally, to keep your logs folder clean, make a folder within and put them in that folder. Note: You will get errors if you forget to make the sub-folder "commandlogs" within logs.

Spoiler


I added two examples of how you could add special exceptions into the plugin. The first checks if the sentence starts with the word "bet". The second checks if the ENTIRE message = "rtd". Note: Those are both commented out via */ and */.

EDIT: If by "Player.txt" you meant to have the filenames be steam IDs, you will have to do the BuildPath inside of the message processing, check Steam ID, and if you're using any of the formats with : in it, then you will need to replace those with _, since : is invalid for filenames.
__________________

Last edited by ThatOneGuy; 12-13-2015 at 23:16.
ThatOneGuy is offline
supreeda
Senior Member
Join Date: Jul 2015
Old 12-14-2015 , 11:13   Re: [REQ] log player command
Reply With Quote #3

Quote:
Originally Posted by ThatOneGuy View Post
Spoiler


Normally, you would want to use IsChatTrigger(), but so many plugins dont register commands, but use chat instead, that you are left with checking chat to catch those. Plugins that use non-registered commands and dont start with ! or /, you will need to code in exceptions for (e.g. "bet ct all").

Basically, the above code will log ALL chat that starts with ! or /, whether or not it shows up in chat (i.e. if it is silent), and whether or not it is actually a command (i.e. someone can type "!hahaha im filling up your server logs", and it will log it. This is needed in order to catch all of the non-registered commands).

Might I suggest though, adding in the date and some code to make it make new files each day? Else you will end up with a giant log. Additionally, to keep your logs folder clean, make a folder within and put them in that folder. Note: You will get errors if you forget to make the sub-folder "commandlogs" within logs.

Spoiler


I added two examples of how you could add special exceptions into the plugin. The first checks if the sentence starts with the word "bet". The second checks if the ENTIRE message = "rtd". Note: Those are both commented out via */ and */.

EDIT: If by "Player.txt" you meant to have the filenames be steam IDs, you will have to do the BuildPath inside of the message processing, check Steam ID, and if you're using any of the formats with : in it, then you will need to replace those with _, since : is invalid for filenames.
Big Thank Bro , Nice work !
supreeda 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 16:28.


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