[FilterScript] Logging
#1

First of all, thanks to the creators of:
  • zcmd
  • sscanf
  • dini
  • Directory plugin
  • SA-MP
Description:

This Filterscript is capable of logging:
  • Death (playerid,killerid,reason)
  • Shooting
  • Chat
  • Commands
  • Enter/Exit Vehicle
  • PlayerTake/DealDamage
  • Interior Change(Oldinterior, NewInterior)
  • Connect/Disconnect(name,Ip,reason);
  • Rcon Login(Wrong/successful)
  • PlayerPosition(logs each players position every 3 seconds by default)
Installation:
  1. Download the package
  2. Put sscanf and Directory into the plugins folder
  3. Put Log.amx into your filterscripts folder
  4. insert sscanf and the Directory plugin into your server.cfg
    Code:
    plugins sscanf Directory
  5. insert Log into your server.cfg
    Code:
    filterscripts Log
  6. Start your server
If any errors occur, just ask for my help.

Configuration:

You can change the configuration per config file which is "Logs\config.cfg" or per /logmenu (Dialog).
Single Commands for all settings are in developement (I am a bit lazy that's why it is still not done).

Bugs , Requests and Ideas:

If you find any bugs, have ideas for improvment or new features, post them here: GitHub Issues Page(Account required)

or post it in this Thread / PM me.

Problems:

Might cause performance problems on bigger servers depending on the settings that you chose.

Future Plans:
  • Better Documentation
  • Functionallity to read logs ingame
  • Control everything per commands
Download:

Note: The GitHub repository includes the .amx, .pwn, includes and plugins(windows & linux).

GitHub

greetings Marcel
Reply
#2

Pastebin Link ?
Reply
#3

is the downloadpackage not enough ?
Reply
#4

Quote:
Originally Posted by [Bios]Marcel
View Post
is the downloadpackage not enough ?
People prefer pastebin so we can see the code before using it or downloading something
Reply
#5

Quote:
Originally Posted by [Bios]Marcel
View Post
I offer you smth else, an .txt inside of my dropbox, so you don't have to be scared ^^.
what if i give you a pastebin link?
Reply
#6

Good, I like it but you have to improve it a lil bit.

1. Reduce string sizes. For example logData[400]; you dont need 400 characters in it, 160 is enough. 128 is maximum size they can enter + 11 characters for date + 10-20 max for cmd text, I doubt anyone will have a command thats bigger than 10-20 chars. Might not sound bad with a small server, but with a bigger one comes in handy.
Date for example can have maximum 10 characters in this case. Lets take highest date that can be
31/12/2016 < 10 chars + space after it (if any) = 11


2. Use switches. Some of the logs will be called constantly, so better save some speed. For example chatlog with 20-30 players online will be called every second atleast so better save some speed
PHP Code:
switch(SaveMode) {
    case 
1format(path,80,"Logs/%s/Commands.log",GetName(playerid));
    case 
2format(path,80,"Logs/%s.log",GetName(playerid));
    case 
3path "Logs/Log.log";
    case 
4path "Logs/Command.log";
    default return 
true//if none of them are selected add path here or just leave return true so it wont continue the code or call some unknown path

3. Use pastebin. Pastebin comes in handy significantly. Text file cannot be marked as a scripting or programming language therefore it can be hard to read + some of the indentification is fked up in text files
Reply
#7

i already reduced some string sizes, but not all, didnt even look at some yet, i dont have much time (actually i dont have time right now but i just take the time hehe) ^^

and i wasnt rly sure if switches are that much faster, but thanks for the advice

I will change it within 2 hours or smth like that
Reply
#8

Quote:
Originally Posted by [Bios]Marcel
View Post
i already reduced some string sizes, but not all, didnt even look at some yet, i dont have much time (actually i dont have time right now but i just take the time hehe) ^^

and i wasnt rly sure if switches are that much faster, but thanks for the advice
Ah alrighty then, well it aint much faster in your case since its like only 4 of the options the script has, but it does affect in long run. Still nice thing you made there, I like the fact its unique since it has options to save wherever you want like player-specific etc. etc.
Reply
#9

Quote:
Originally Posted by [Bios]Marcel
View Post
If you want any other features tho, just tell me i will add them probably if i like it ^^


aaand by the way , my job educator (tutor or whatever to call him) says that a switch isnt faster its the same but it looks diffrent
Actually you could add something to make this even more unique. You could add logs based on days.

For example it would call getdate() check if the file exist with that tittle and then insert into it.

File name would be todays date, all logs made today would be inserted into it.

Its quite tricky to make but would improve it significantly. No one done it (well released) something like this so far so it might make it stick out for people.


Log name example would be

Option 1 < days of the year. Using getdate() with return value. Example Day_2.log

Option 2 < exact date. So for example 27/1/2016.log
Reply
#10

Quote:
Originally Posted by TwinkiDaBoss
View Post
Actually you could add something to make this even more unique. You could add logs based on days.

For example it would call getdate() check if the file exist with that tittle and then insert into it.

File name would be todays date, all logs made today would be inserted into it.

Its quite tricky to make but would improve it significantly. No one done it (well released) something like this so far so it might make it stick out for people.
Actually that sounds like a good idea, i will do that, shouldnt be too tricky ^^
Reply
#11

Quote:
Originally Posted by TwinkiDaBoss
View Post
Actually you could add something to make this even more unique. You could add logs based on days.

For example it would call getdate() check if the file exist with that tittle and then insert into it.

File name would be todays date, all logs made today would be inserted into it.

Its quite tricky to make but would improve it significantly. No one done it (well released) something like this so far so it might make it stick out for people.


Log name example would be

Option 1 < days of the year. Using getdate() with return value. Example Day_2.log

Option 2 < exact date. So for example 27/1/2016.log
I am Done, i havent tested it yet, cuz i am too lazy but i am done ^^

I have added the option do create Daily, monthly, hourly and yearly logs
Reply
#12

sorry for the late pastebin link

http://pastebin.com/YW1nFD4E
Reply
#13

Now everything is on github
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)