Code:
decl Float:vecOrigin[3], Float:vecPos[3];
GetClientAbsOrigin(client, vecOrigin);
new Handle:trace = TR_TraceRay(vecOrigin, {-90.0, 0.0, 0.0}, MASK_SHOT_HULL, RayType_Infinite);
if(TR_DidHit(trace)) {
TR_GetEndPosition(vecPos, trace);
if(vecOrigin[2]-vecPos[2]> SOME DISTANCE ) {
// they're more than SOME DISTANCE units off the ground
}
}
CloseHandle(trace);
this will return the distance between the player and the ground. reverse the angle and you'll have what you want. Probably want to make a filter to ignore the player. found it from the first result in this google "
sourcemod traceray ground"