DeleteLocalFloat(object, string)

Deletes oObject's float variable sVarName

void DeleteLocalFloat(
    object oObject,
    string sVarName
);

Parameters

oObject

The object storing the variable.

sVarName

Variable name to delete.


Description

Use this function to delete an object's entry for the float defined by sVarName. If sVarName doesn't exsist, nothing will happen.



Remarks

As with all deletions, once removed, GetLocalFloat returns 0.0. Cleaning up old variables can help CPU performance if many are stored on one object (especially if the module has many unused values on it) and good for deleting the new persistant variables which can be put on a PC's inventory item, which will hinder performance if there are many unused values.


Version

1.22

Example

// Placed in an area's OnEnter event, this script determines if the
// entering object is a player, and if so, deletes the float "fTimer"
// Remember, it will delete fTimer, even if fTimer's value doesn't exsist.
void main()
{
    object oPC = GetEnteringObject();
    if(GetIsPC(oPC))
    {
        DeleteLocalFloat(oPC, "fTimer);
    }
}

See Also

categories: Local Variables Functions


 author: Michael Nork, editor: Jasperre, additional contributor(s): Jasperre