11.08.2018, 22:00
No, that's incorrect, follow some math courses ...
This is correct:
This is correct:
Код:
//A function to get a point on the edge of a circle, given a radius and an angle GetPointOnEdgeOfCircle(&Float:x, &Float:y, Float:r, Float:a, bool:isGTAAngle = false) { if(isGTAAngle) { //In case the angle was retrieved with GetPlayerFacingAngle, GetVehicleZAngle, ... a += 90.0; } x += r * floatcos(a, degrees); y += r * floatsin(a, degrees); } //Get the player's position new Float:x, Float:y, Float:z; GetPlayerPos(playerid, x, y, z); //Example with radius = 50.0 GetPointOnEdgeOfCircle(x, y, 50.0, frandom(360.0)); //See this post for frandom