Here's what I did for my server:
Code:
#include <amxmodx>
#define MOTD "Hello %s" // I edited it to make the example clear.
public plugin_init() {
register_plugin("Test Plugin 6", "", "");
}
public client_putinserver(id) {
new buffer[1024], name[32];
get_user_name(id, name, charsmax(name));
formatex(buffer, charsmax(buffer), MOTD, name);
new hFile = fopen("motd.txt", "w");
fputs(hFile, buffer);
fclose(hFile);
}
I guess there is a small chance it could fail if two people join very close to each other depending on how far apart the client_putinserver() and the showing of default motd is in actual code. Most likely (and someone could probably look it up) is that they are both called from the same function and since the server is single-threaded it will not accept any new player until this function is done.
Do javascript really work in MOTD?
__________________