dev
dev copied to clipboard
Add `KeepAngle(var)` to Built-in Commands
This function should be in charge of maintaining the value of a floating variable, within 360 degrees, in the form of endless tape. That is to say, that if it is passed of the 360, this one must pass to value 0 and vice versa.
KeepAngle(@18) // float
/** Parameter:
* 1 - var or lvar
*/
translate to
if @18 > 360.0
then @18 -= 360.0
end
if @18 < 0.0
then @18 += 360.0
end
As far as I'm concerned, doesn't the GTA 3D games use radians?
@NicusorN5 Not natively, not with some opcode. But on the part of SAMPFuncs yes, 2 are added
0C01: samp math 1@ = radian_to_angle 0@ // (float)
0C02: samp math 0@ = angle_to_radian 1@ // (float)
can be implemented with #206