If Port's link didn't help, here's another explanation I guess... (I was in the middle of typing so might as well post it)
It also has exactly what you need at the bottom if you wanted to compare or something
Whenever you overwrite an already existing function, you can use something called a package if you want the original function to still be called.
//Packages
package MyPackage
{
//Some functions in here
}; //Note the semicolon after the package
//Package Functions
ActivatePackage(MyPackage);
DeActivatePackage(MyPackage);
MyPackage is your new page, where you can put the functions you're writing.
You use activatePackage and deactivatePackage to basically turn it on and off.
This still doesn't solve your problem. We put the function in a package but it's still overwriting, so now you need to call the parent (the function you overwrote). You can do this anywhere in your newly defined function by this:
Parent::FunctionName(FunctionParameters);
So for your example, since we're calling functions on the player, we'd rather let the original script take care of all of it's things first (so it actually spawns the player for us to use)
package mySpawnPlayerPackage
{
function gameconnection::spawnplayer(%a)
{
Parent::spawnplayer(%a);
%file = new fileobject();
%file.openforread("config/server/serverupgrade/colornames/"@%a.name@".txt");
%a.player.setshapenamecolor(%file.readline());
%file.close();
%file.delete();
}
};
ActivatePackage(mySpawnPlayerPackage);