Look for c_move in the manual, within that article there is a movement code with gravity.
You won't find anything with 'gravity', because it is handled with c_trace.
Means, a trace is sent from the models origin to a point beneath it, and then in the c_move instruction a value is subtract from the entities z value as long as it doesn't touch the ground, means doesn't reach a set minimal height position above the ground.
That's not easy to understand, but, if you want learn the coding in 3DGS and its handling of collision, you should have a close look at the example code in the c_move article.