Author Topic: Please remove  (Read 1221 times)

Delete..

User was banned for this post
« Last Edit: February 26, 2016, 08:32:00 PM by Badspot »

To get a objects type, do %object.getClassName(). Typemasks are used for raycasts.
Edit: in answer to:
Quote
if (%mask = $TypeMasks::PlayerObjectType)
               {
                  %mask.getClient().player.burn(1);
               }
« Last Edit: February 26, 2016, 07:09:34 AM by Dannu »

To get a objects type, do %object.getClassName(). Typemasks are used for raycasts.

I'm trying to use a radius search, and it searches for typemasks within it. I need to be able to find the actual object ID from the radius search locating that typemask.

%object.getType() & $TypeMasks::PlayerObjectType

Dont edit your posts, it makes the thread harder to follow.

The %mask argument already takes care of all that. It only finds objects matching the mask you provide. To find $Typemask::PlayerObjectType just set the mask to that.

Dont edit your posts, it makes the thread harder to follow.

The %mask argument already takes care of all that. It only finds objects matching the mask you provide. To find $Typemask::PlayerObjectType just set the mask to that.

You're not getting the point... I've already been able to detect if a player has entered the radius, it's just that I need to be able to get the ID of it.

            %loc = %BID.getPosition;
            %radius = %BID.getDestructionVolume;
These are functions, not variables. So they should be like %loc = %BID.getPosition();

For the radius search just do:
Code: [Select]
%mask = $Typemasks::PlayerObjectType;
initContainerRadiusSearch(%loc, %radius, %mask);

while(isObject(%player = containerSearchNext()))
{
%player.burn(1);
}
The while statement will cycle through every player within the radius and run the code inside on each player. Starting with the closest player and ending with the farthest player.
containerSearchNext(); returns the next player in the list.

These are functions, not variables. So they should be like %loc = %BID.getPosition();

For the radius search just do:
Code: [Select]
%mask = $Typemasks::PlayerObjectType;
initContainerRadiusSearch(%loc, %radius, %mask);

while(isObject(%player = containerSearchNext()))
{
%player.burn(1);
}
The while statement will cycle through every player within the radius and run the code inside on each player. Starting with the closest player and ending with the farthest player.
containerSearchNext(); returns the next player in the list.

I already knew all that and had it set up right, I just need to know how to get the ID of the player that is located. Again, It already works I just need to know how to get the ID

I the code that jes00 posted, %player is the id