View Single Post
Dominatez
Senior Member
Join Date: Oct 2009
Location: Birmingham, UK
Old 10-23-2022 , 13:05   Re: [L4D2] Super Tanks
Reply With Quote #341

There is an error somewhere in the code, but i am just not seeing it.

SuperTanks_for_sonic.sp(1969) : error 001: expected token: ";", but found "-identifier-"

Which is around this piece of code.

Code:
stock int NearestSurvivor(int j)
{
	int target, float InfectedPos[3], SurvivorPos[3], nearest = 0.0; //* This Is Line 1969 *//
   	for (int i=1; i<=MaxClients; i++)
	{
		if (IsClientInGame(i) && IsPlayerAlive(i) && GetClientTeam(i) == 2 && ChaseTarget[i] == 0)
		{
			GetClientAbsOrigin(j, InfectedPos);
			GetClientAbsOrigin(i, SurvivorPos);
			float distance = GetVectorDistance(InfectedPos, SurvivorPos);
			if (nearest == 0.0)
			{
				nearest = distance;
				target = i;
			}
			else if (nearest > distance)
			{
				nearest = distance;
				target = i;
			}
		} 
	}
	
	return target;
}

Last edited by Dominatez; 10-23-2022 at 13:05.
Dominatez is offline