I'm using the following code but the add_laps never gets triggered:
action boat
{
player = me;
phent_settype(my, PH_RIGID, PH_BOX);
ph_setgravity( earth_gravity );
phent_setmass(my, 70, PH_POLY);
phent_setfriction(my,0);
phent_setelasticity(my, 25, 1);
phent_setdamping(my, 90, 90);
while(1)
{
phent_getvelocity(my, velocity3, nullvector);
velocity = vec_length(velocity3);
if(key_cuu == 1)
{
vec_set(temp.x, my); vec_normalize(temp, 450000);
phent_addforcelocal(my, temp, nullvector);fire();
}
if(key_cud == 1)
{
vec_set(temp.x, my); vec_normalize(temp, -25000);
phent_addforcelocal(my, temp, nullvector);
}
if(key_cul == 1 && velocity > 60)
{
phent_addtorqueglobal (my, vector(0, 0, 4000));
}
if(key_cur == 1 && velocity > 60)
{
phent_addtorqueglobal (my, vector(0, 0, -6000));
}
c_trace (temp.x, my, scan_texture|ignore_me);
if (str_cmpi (tex_name, "checker1"))
{
add_laps();
}
boat_camera();
wait(1);
}
}