[ create a new paste ] login | about

Link: http://codepad.org/2yS7wXAQ    [ raw code | fork ]

hurracane - C, pasted on Jun 21:
manageRadar()
{
	while(1)
	{
		if(isDefined(objectives_amount))
			for(i=0;i<objectives_amount;i++)
				objective_delete(i);
			
		objectives_amount = 0;
		
		// filter out people that aren't frozen anymore
		newarray_allies = [];
		newarray_axis = [];
		
		for(i=0;i<level.objectives["allies"].size;i++)
			if(isPlayer(level.objectives["allies"][i]) && level.objectives["allies"][i].sessionstate == "playing" && level.objectives["allies"][i].frozen)
				newarray_allies[newarray_allies.size] = level.objectives["allies"][i];
				
		for(i=0;i<level.objectives["axis"].size;i++)
			if(isPlayer(level.objectives["axis"][i]) && level.objectives["axis"][i].sessionstate == "playing" && level.objectives["axis"][i].frozen)
				newarray_axis[newarray_axis.size] = level.objectives["axis"][i];	
		
		
		level.objectives["allies"] = newarray_allies;
		level.objectives["axis"] = newarray_axis;
		
		if(objectives_amount >= 16)
		{
			wait 1;
			continue;
		}
		for(i=0;i<level.objectives["allies"].size;i++)
		{
			if(objectives_amount >= 16)
			{
				iprintln("Did not put " + level.objectives["allies"][i].name + " ^7on compass, ");
				iprintln("maximum number of objectives reached (16)");
				break;
			}
			objective_add(objectives_amount, "current", level.objectives["allies"][i].origin, "gfx/hud/objective.tga");
			objective_icon(objectives_amount,"gfx/hud/objective.tga");
			objective_team(objectives_amount, "allies");
			objectives_amount++;
		}
		for(i=0;i<level.objectives["axis"].size;i++)
		{
			if(objectives_amount >= 16)
			{
				iprintln("Did not put " + level.objectives["axis"][i].name + " ^7on compass, ");
				iprintln("maximum number of objectives reached (16)");
				break;
			}
			objective_add(objectives_amount, "current", level.objectives["axis"][i].origin, "gfx/hud/objective.tga");
			objective_icon(objectives_amount,"gfx/hud/objective.tga");
			objective_team(objectives_amount, "axis");
			objectives_amount++;
		}
		wait .5;
	}
}


Create a new paste based on this one


Comments: