Hi guys i tried to make a plugin which teleport terrorist on a circle
here is my code:
HTML Code:
void Circle(int target, int radius)
{
int d = radius;
float newpos[3];
float targetpos[3];
GetClientAbsOrigin(target, targetpos);
for (int i = 1; i <= MaxClients; i++)
{
if (IsClientInGame(i) && IsPlayerAlive(i) && target != i && GetClientTeam(i) == 2)
{
float x = (Cosine(PI * 2 * i / n) * d);
float y = (Sine(PI * 2 * i / n) * d);
newpos[0] = targetpos[0] + x;
newpos[1] = targetpos[1] + y;
newpos[2] = targetpos[2];
float vec[3];
SubtractVectors(targetpos, newpos, vec);
NormalizeVector(vec, vec);
float angles[3];
GetVectorAngles(vec, angles);
TeleportEntity(i, newpos, angles, NULL_VECTOR);
}
}
}
but not working,can someone fix this?