OsClearObjectAnimations

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Add exemple)
(Add another exemple)
 
Line 31: Line 31:
 
             llSay(PUBLIC_CHANNEL, "There is " + (string)total + " animation running in this object ...");
 
             llSay(PUBLIC_CHANNEL, "There is " + (string)total + " animation running in this object ...");
 
         }
 
         }
 +
    }
 +
}
 +
</source>
 +
<source lang="lsl">
 +
//
 +
// osClearObjectAnimations Script Exemple
 +
// Author= djphil
 +
//
 +
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
        llSay(PUBLIC_CHANNEL, "Drop this script to the object's inventory (animesh) to see osClearObjectAnimations usage.");
 +
        llSay(PUBLIC_CHANNEL, "The script will then be automatically deleted from the object's inventory (animesh).");
 +
 +
        integer total = osClearObjectAnimations();
 +
 +
        if (total > 0)
 +
        {
 +
            llSay(PUBLIC_CHANNEL, (string)total + " animation(s) of this object (animesh) have been cleared with success ...");
 +
        }
 +
 +
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "There is " + (string)total + " animation running in this object ...");
 +
        }
 +
 +
        llRemoveInventory(llGetScriptName());
 
     }
 
     }
 
}
 
}

Latest revision as of 12:00, 2 December 2020

integer osClearObjectAnimations()
Clears all animations on the prim, returning how many it had running.
Threat Level This function does not do a threat level check
Permissions Use of this function is always allowed by default
Extra Delay 0 seconds
Example(s)
//
// osClearObjectAnimations Script Exemple
// Author= djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Right click on this object (animesh) and select \"Touch\" to see osClearObjectAnimations usage.");
    }
 
    touch_start(integer number)
    {
        integer total = osClearObjectAnimations();
 
        if (total > 0)
        {
            llSay(PUBLIC_CHANNEL, (string)total + " animation(s) of this object (animesh) have been cleared with success ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "There is " + (string)total + " animation running in this object ...");
        }
    }
}
//
// osClearObjectAnimations Script Exemple
// Author= djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Drop this script to the object's inventory (animesh) to see osClearObjectAnimations usage.");
        llSay(PUBLIC_CHANNEL, "The script will then be automatically deleted from the object's inventory (animesh).");
 
        integer total = osClearObjectAnimations();
 
        if (total > 0)
        {
            llSay(PUBLIC_CHANNEL, (string)total + " animation(s) of this object (animesh) have been cleared with success ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "There is " + (string)total + " animation running in this object ...");
        }
 
        llRemoveInventory(llGetScriptName());
    }
}
Notes
Added in 0.9.2.0


Personal tools
General
About This Wiki