Author Topic: ContainerRadiusSearch not picking up on scaled players  (Read 620 times)

Hi BLF! When I scale a player to >0.9 size, they won't be detected by my code.

initContainerRadiusSearch(%client.player.getPosition(), 5, $Typemasks::PlayerObjectType);
%player = containerSearchNext();
while(%player = containerSearchNext())
{
   talk("I = " %i);
   if(%player.client == %client)
      return;
   if(%player.client.name $= "")
      return;
   if(%player.isGhost == 1)
      return;
   announce("\c3" @ %player.client.name @ "\c5 just got \c1G\c2R\c3O\c4U\c5U\c1U\c2N\c3D\c4D\c5P\c1P\c2O\c3O\c4U\c5U\c1U\c2N\c3D\c4D\c5D\c1E\c2E\c3E\c4D\c5D\c1D\c2!\c3!\c4!");
   %player.addVelocity("0 0 3000");
   %player.schedule(300, setVelocity, "0 0 -3000");
   %player.schedule(300, kill);
}


I'm clueless. What's going on here? If I scale them back to above 0.9 0.9 0.9, it works.

Remove this line before your while loop:

%player = containerSearchNext();

Right now, you're skipping the first object.

Instead of using return;, use continue; so it keeps looping

You can also use break; instead of return to stop the loop but keep going through the function

also just a note 200 is the max velocity a normal player can travel so

"0 0 3000" will be scaled to "0 0 200"

talk("I = " %i); is also a syntax error because there's nothing connecting the variable to the string. @ connects. SPC connects it with a space. TAB connects it with a tab. NL connects it with a new line.