This piece of code is the first problem I think.
# Source function library.
When I try to start that script I get this error:
.: 18: Can't open /etc/rc.d/init.d/functions
and I really can't find any "functions" anywhere in etc and sub-directories.
That shell file (in other Linux distros such as Red Hat and derivatives) provides support routines for init.d scripts, such as killproc and status. It's not needed if you rewrite that functionality directly into your init.d script. See other init.d scripts on your system for how to do that.
So I simply deleted the line in search for more errors
then I get this error:
/etc/init.d/TM: Daemon not found: /home/penguisher/TrackmaniaServer_2009-08-01/server.sh
If there's no server.sh file in that directory, then obviously it cannot be found. This shell script simply calls the dedicated with the right parameters, e.g.:
cd /home/<your path>
./TrackmaniaServer /internet /game_settings=MatchSettings/<your settings>.txt /dedicated_cfg=dedicated_cfg.txt
Also I don't know what this does:
So I left it the way it was in the example.
On my system I run multiple classic TMN and TMF servers, so I renamed each dedicated executable into a unique name in order to distinguish them in a process list (necessary for the init.d stop command, for example). In your case, if you run just one server, you can use the default name 'TrackmaniaServer' there.