Quote:
Originally Posted by Vince
PHP код:
new const checkPointRadius = 15;
new
Float:randomAngle = float(random(360)),
Float:randomDistance = random(checkPointRadius);
new
Float:dropX = checkPointX + floatsin(-randomAngle, degrees) * randomDistance,
Float:dropY = checkPointY + floatcos(-randomAngle, degrees) * randomDistance,
Float:dropZ = checkPointZ + 0.5;
Something like that should work. This picks a random angle between 0 and 360 (a full circle, as you know) and a random distance between 0 and the size of the radius of the checkpoint. Then some trig is done to calculate the coordinates at the specified angle and the specified distance. Can't really explain that. Rather mathematically complex.
|
Thank you very much man. This helped a lot!