Adds osGetHealth.

Returns the amount of health (in an integer) that an avatar has left in the scene.
If an avatar is not found or safe is enabled on a region, -1 is returned.

Example usage:

default
{
    touch_end(integer _t)
    {
        key agentID = llDetectedKey(0);
        osCauseDamage(agentID, 50);
        llSay(0, llKey2Name(agentID) + " has " + (string)osGetHealth(agentID) + "% health left.");
    }
}
This commit is contained in:
TBG Renfold
2012-08-09 18:03:26 +01:00
committed by Justin Clark-Casey (justincc)
parent aede42b875
commit 4f3fabae5b
3 changed files with 28 additions and 1 deletions

View File

@@ -865,7 +865,12 @@ namespace OpenSim.Region.ScriptEngine.Shared.ScriptBase
{
m_OSSL_Functions.osSetSpeed(UUID, SpeedModifier);
}
public LSL_Float osGetHealth(string avatar)
{
return m_OSSL_Functions.osGetHealth(avatar);
}
public void osCauseDamage(string avatar, double damage)
{
m_OSSL_Functions.osCauseDamage(avatar, damage);