07.09.2016, 23:23
(
Last edited by Dayrion; 09/09/2016 at 09:53 AM.
)
Create a circle with an object and get the center's coordinates.
PHP Code:
CreateCircle(objectid, Float:x, Float:y, Float:z, Float:size, &Float:valA2, &Float:valB2, &Float:valC2)
{
new Float:valx2,
Float:valy2,
Float:valz2;
for(new i; i < 360; i++) // 3498 - 1214
{
if(i == 180)
{
valx2 = x;
valy2 = y;
valz2 = z;
}
x = x+size*floatcos(i,degrees);
y = y+size*floatsin(i,degrees);
if(objectid != 0) CreateObject(objectid, x, y, z, 0.0, 0.0, 0.0);
}
GetCoordMid2Pts(valx2, valy2, valz2, x, y, z, valA2, valB2, valC2);
}
stock GetCoordMid2Pts(Float:x1, Float:y1, Float:z1, Float:x2, Float:y2, Float:z2, &Float:rX, &Float:rY, &Float:rZ)
{
rX = (x1+x2)/2;
rY = (y1+y2)/2;
rZ = (z1+z2)/2;
}