Nice solution. I would like to optimize the code:

vec_set(mG_tempvec.x,my.x);
mG_tempvec.z -=200; //trace 200 quants below (floor)

mActor_height = c_trace(my.x,mG_tempvec.x,
ignore_me + activate_sonar +use_box); //normal first trace

slopecheck = off;
if (normal.z < 0.45) //Potential slope. You may raise this value for less tolerance to slopes
{
oldnormalz = normal.z;
//start a second trace 8 quants below the player origin
c_trace(vector(my.x,my.y,my.z-8), mG_tempvec.x, ignore_me + activate_sonar +use_box);

if (abs(normal.z - oldnormalz) <0.01)
{
slopecheck = on;
}
}

if (mActor_height>2 || slopecheck)
{
//player is on the air OR a slope. Apply gravity
}
else
{
//player is on ground or stairs. Move freely.
}