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.
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.
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.
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.