DestroyNearestObjectByTag(string, object, float)

Destroy the nearest object in the source's area by tag.

void DestroyNearestObjectByTag(
    string sTag,
    object oSource = OBJECT_SELF,
    float fDelay = 0.1
);

Parameters

sTag

The tag you are interested in.

oSource

An object in the area you are interested in. (Default: OBJECT_SELF)

fDelay

Delay (in seconds) before object is destroyed. (Default: 0.1)


Description

Destroys the nearest object in oSource's area whose tag matches sTag.



Remarks

This is a wrapper for DestroyObject.

oSource should not be an area, it should be an object IN the area you are interested in. It might actually still work if oSource is an area but that isn't what the intent of the function is.

This uses GetNearestObjectByTag to locate the closest object with sTag to oSource. Given how GetNearestObjectByTag works, it will not search for a match outside of the area that oSource is in.


Requirements

#include "x0_i0_destroy"


Version

???

See Also

functions:  DestroyObject | GetNearestObjectByTag
categories:  Area Functions


author: Mistress