You have the right idea your just missing one piece.
Your MakeTrack function should look like this
void MakeTrack(objectnumber,piece,posx,posy,posz,anglx,angly,anglz){
if (piece==1)dbLoadObject("resources//tunnel.x",objectnumber);
if (piece==2)dbLoadObject("resources//tunnel turn left.x",objectnumber);
if (piece==3)dbLoadObject("resources//tunnel turn right.x",objectnumber);
dbTextureObject(objectnumber,1);
dbPositionObject(objectnumber,posx,posy,posz);
dbRotateObject(objectnumber,anglx,angly,anglz);}
You had most of it right you were just missing the return type you could have used anything e.g float,int, or void. So all your functions should look something like this
void MakePlayer(int Obj)
{
//code
}
or
float Calc(float Num1,float Num2)
{
float Difference;
Difference = Num1 - Num2;
return Difference;
}
If your going to write a function like the one above though your call will look different instead of just
Calc();
you'll have to have a variable to store the value coming back in e.g
Num = Calc();
The only limit to creating video games is your imagination