12.08.2018, 08:36
Quote:
No, that's incorrect, follow some math courses ...
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 |
I'm making a 'dumpster diving' system (you can pick up up trashes from the dumpsters and drop it around the player). That i made is almost working as i want, but there is a bug whenever the object hit the player which cause collapse damage (about 3-25 points) for the player.
How i should make this system to place the object around the player like this?