yeah, you should just create the explosion in a seperate function
function explosion(){
//do special stuff here
}
function player_crash(){
explosion();
}
function ai_crash(){
explosion();
}
you could also pass parameters to the function to let it know where it occurs, or who to etc...
function explosion(VECTOR* temp_vec, ANGLE* temp_ang){
//do explosion
}
function player_crash(){
explosion(my.x, my.pan);
}
this really should be void function as nothing is being returned,
hope this helps