27.01.2016, 14:58
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
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
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 1: format(path,80,"Logs/%s/Commands.log",GetName(playerid));
case 2: format(path,80,"Logs/%s.log",GetName(playerid));
case 3: path = "Logs/Log.log";
case 4: path = "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
}