I always get mixed results with findentinsphere, i prefer to loop through all the ents and check the classname as its give me better results and is probably a lot more economical and less cpu than findentinsphere.
I also hate using static variables because I never get any consistance (i probably use them wrong half the time lol) so I stick with new style variables.
PHP Code:
public plugin_init()
set_task(0.1, "force_spin", _, _, _, "b");
public force_spin()
if (get_timeleft())
{
new classname[11], Float:angles[3], ent = -1, ent_total = engfunc(EngFunc_NumberOfEntities) + 30;
while (ent++ < ent_total)
if (pev_valid(ent))
{
pev(ent, pev_classname, classname, 10);
if (containi(classname, "armoury") != -1 || containi(classname, "weaponbox") != -1)
{
pev(ent, pev_angles, angles);
//angles[1] += get_pcvar_float(speed_pcvar) / 10.0;
angles[1] += 27.0;
if(angles[1] >= 180.0)
angles[1] -= 360.0;
set_pev(ent, pev_angles, angles);
}
}
}