public OnPlayerConnect(playerid) { // Get player name new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid, pname, MAX_PLAYER_NAME); // Get player IP new playerip[17]; GetPlayerIp(playerid, playerip, 17); // Format string for log new string[256]; format(string, sizeof(string), "[ipjoin] %i %s %s", playerid, pname, playerip); // Write string to log file add_log(string); // Exit here return 1; } // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // ----------------------------------------------------------------------------- // Adds a line of text to the IRC Echo Log // --------------------------------------- add_log(text[]) { new File:fp = fopen("echo.txt", io_append), tmp[1024]; format(tmp, 1024, "%s\n", text); fwrite(fp, tmp); fclose(fp); }