You need to use mouse_force.x/y for this:
Code:
void grabRotate()
{
if(event_type== EVENT_CLICK)
{
while(mouse_left== 1)
{
my->pan+= (mouse_force.x * 10) * time_step;
my->tilt-= (mouse_force.y * 10) * time_step;
wait(1);
}
}
}
void event_handle()
{
my->emask|= ENABLE_CLICK;
my->event= grabRotate;
}
...
ent_create("[i]filename here[/i]",[i]vector pos[/i],event_handle);
That's a basic "rotate entity with mouse" code.