sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
49 stars 0 forks source link

Add `KeepAngle(var)` to Built-in Commands #207

Closed MatiDragon-YT closed 3 months ago

MatiDragon-YT commented 2 years ago

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
NicusorN5 commented 2 years ago

As far as I'm concerned, doesn't the GTA 3D games use radians?

MatiDragon-YT commented 2 years ago

@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)
x87 commented 3 months ago

can be implemented with #206