Thanks to Frazzle, this one works for me,
Code:
function create_objects()
{
var distTrace;
wait(1);
c_setminmax(me);
my.polygon = on;
vec_set(temp, my.x);
vec_sub(temp, vector(0,0,1000));
trace_mode= ignore_me | ignore_passable | use_box;
distTrace = c_trace(my.x,temp,trace_mode);
if (distTrace> 0)
{
my.z -= distTrace;
}

}

//example function
function place_object2()
{
temp.x = 200; // place the object 200 quants in front of the creator
temp.y = 0;
temp.z = 0;
vec_rotate (temp, player.pan);//be carefull to set "current_player" to your player name.
vec_add (temp, player.x);
ent_create(object2_mdl, temp.x, create_objects);

}



Just enable polygon collision in properties or by script on your model terrain (I always use model terrains)

Last edited by Nems; 12/06/07 17:32.