There is the potential for the function
"action lefttire"
to run BEFORE carbody has been filled.
So I would insert the folowing code
action lefttire()
{
tireleft=me;
//
while(carbody==NULL) wait(1); //<<<< Line to insert
//
phent_settype (my, PH_RIGID, PH_SPHERE);
This way the tyre code will wait until the carbody exists before it tries
to join with it.
In reality, this line could be placed anywhere in you code as long as it comes
before the "joinbody= phcon_add( PH_WHEEL, carbody, my);" line.
But where Ive got it, I think there will be less load on the physics engine
when there is no carbody.