create a function to cap the values.
To use this, simply call minmax with the appropriate minimum and Max values.
example,...
print minmax (5,0,10) ; will return 5
print minmax (50,0,10) ;will return 10
print minmax (-10,0,10) ; will return 0
in your own code, you can use:
mousewheelposition=minmax(MouseZ(), minimum,maximum)
Edit: ahhh I see the problem you are having,... You will need to use this instead:
now you are using the speed of the wheel to move rather than the absolute position.
Function minmax# (value#,minval#,Maxval#) If value > maxval value = maxval If value < minval value = minval Return value End Function
To use this, simply call minmax with the appropriate minimum and Max values.
example,...
print minmax (5,0,10) ; will return 5
print minmax (50,0,10) ;will return 10
print minmax (-10,0,10) ; will return 0
in your own code, you can use:
mousewheelposition=minmax(MouseZ(), minimum,maximum)
Edit: ahhh I see the problem you are having,... You will need to use this instead:
mousewheelposition=minmax(mousewheelposition + MouseZSpeed(), -5 ,-1)
now you are using the speed of the wheel to move rather than the absolute position.