Skip to content
lsl.devlsl.devLSL Dev

LlClearPrimMedia

Looking for the current API? Open the llClearPrimMedia reference →

Wiki description

Clears (deletes) the media and all params from the given face.

Return value notes

Returns an integer that is a STATUS_* flag which details the success/failure of the operation.

Specification

STATUS_OK integer 0 m=3 c=Result of function call was success
STATUS_MALFORMED_PARAMS integer 1000 m=3 c=Function was called with malformed parameters
STATUS_TYPE_MISMATCH integer 1001 m=3 c=Argument(s) passed to function had a type mismatch
STATUS_BOUNDS_ERROR integer 1002 m=3 c=Argument(s) passed to function had a bounds error
STATUS_NOT_FOUND integer 1003 m=3 c=Object or other item was not found
STATUS_NOT_SUPPORTED integer 1004 m=3 c=Feature not supported
STATUS_INTERNAL_ERROR integer 1999 m=3 c=An internal error occurred
STATUS_WHITELIST_FAILED integer 2001 m=3 c=Whitelist Failed
Success/Failure Flags Description

Examples

//  when dropping this script into a prim
//  it will remove all set media-on-a-prim
//  on all sides of the prim containing the script
//  and then the script will delete itself



publish_returned_status_flag(integer inputLink, integer inputFace, integer inputStatus)
{
    /* if (inputInteger == 0) */ string outputStatus = "STATUS_OK";
    if (inputStatus == 1000) outputStatus = "STATUS_MALFORMED_PARAMS";
    else if (inputStatus == 1001) outputStatus = "STATUS_TYPE_MISMATCH";
    else if (inputStatus == 1002) outputStatus = "STATUS_BOUNDS_ERROR";
    else if (inputStatus == 1003) outputStatus = "STATUS_NOT_FOUND";
    else if (inputStatus == 1004) outputStatus = "STATUS_NOT_SUPPORTED";
    else if (inputStatus == 1999) outputStatus = "STATUS_INTERNAL_ERROR";
    else if (inputStatus == 2001) outputStatus = "STATUS_WHITELIST_FAILED";

    // PUBLIC_CHANNEL has the integer value 0
    llSay(PUBLIC_CHANNEL, "llClearLinkMedia(link " + (string)inputLink
        + ", face " + (string)inputFace + ") = " + outputStatus + ";");
}

default
{
    state_entry()
    {
        integer link = llGetLinkNumber();
        integer numOfSides = llGetLinkNumberOfSides(link);
        integer face;

        do
        {
            integer clearMediaSucceeded = llClearPrimMedia(face);
            publish_returned_status_flag(link, face, clearMediaSucceeded);

            ++face;
        }
        while (face < numOfSides);

        string thisScript = llGetScriptName();
        llRemoveInventory(thisScript);
    }
}

See also: functions

History

Shared wiki helpers

The original page also injects shared parameter notes, caveats or issue information through these helpers. Their conditional MediaWiki logic is not reproduced here; inspect the preserved helper source for additional material.

Template:Issues/SVC-4939

Original shared helper source (conditional wiki logic is not evaluated)
{{Issues|SVC-4939|[http://svn.secondlife.com/trac/linden/changeset/2816 SVN Changeset 2816 in Trunk] is immature|type=bug|dnc=*}}

Template:LSL Function/face

Original shared helper source (conditional wiki logic is not evaluated)
{{LSL Injection Test}}{{#if:

{{#vardefine:header|{{#var:header}}{{#if:{{{nc|}}}{{#pos:{{#var:moded}}|r}}||{{#switch:{{NAMESPACE}}|Template=|User=|[[Category:LSL Face{{#var:lang}}]][[Category:LSL Face{{#var:lang}}/{{#if:{{{return|}}}{{{returns|}}}|Get|Set}}]]}}}}}}

{{#vardefine:ALL_SIDES|{{LSL Const|ALL_SIDES|integer|-1|hex=0xFFFFFFFF}}}}

{{#vardefine:p_{{{1|none}}}_desc|{{LSLGC|Face{{#var:lang}}|face}} number{{#ifeq:{{{notall|}}}|*||<nowiki> </nowiki>or {{#var:ALL_SIDES}}}}}}

{{#vardefine:p_{{{1|none}}}_hover|face number{{#ifeq:{{{notall|}}}|*||<nowiki> </nowiki>or ALL_SIDES (-1)}}}}

{{#ifeq:{{{notall|}}}|*||{{#vardefine:facechoise|If {{LSLP|{{{1|none}}}}} is {{#var:ALL_SIDES}} then the {{#if:{{{2|}}}|{{{2|}}}|function}} {{#if:{{{get|}}}|{{{get|}}}|{{#if:{{{ALL_SIDES|}}}|{{{ALL_SIDES|}}}|works on all sides.}}}}}}}}

{{#vardefine:header_footnote|{{#var:header_footnote}}{{#if:{{{!footer|}}}||{{PBR}}
{{#var:facechoise}}{{PBR}}}}}}

{{#vardefine:caveats|{{#var:caveats}}{{#if:{{{!footer|}}}|
*{{#var:facechoise}}|}}{{#if:{{{return|}}}{{{returns|}}}|
*If {{LSLP|{{{1|none}}}}} indicates a face that does not exist the {{#if:{{{2|}}}|{{{2|}}}}} {{#if:{{{return|}}}|return is {{{return|}}}| returns {{{returns|}}}}}|
*The {{#if:{{{2|}}}|{{{2|}}}|function}} silently fails if its {{LSLP|{{{1|none}}}}} value indicates a face that does not exist.}}}}

}}<noinclude>
{| {{Prettytable}}
|-{{Hl2}}
! #var
! value
|-
{{VarPair|ALL_SIDES}}
|-
{{VarPair|p_{{{1|none}}}_desc}}
|-
{{VarPair|p_{{{1|none}}}_hover}}
|-
{{VarPair|facechoise}}
|-
{{VarPair|header_footnote}}
|-
{{VarPair|caveats}}
|}
</noinclude>
Original wiki source

Some wiki templates and tables need their original context. View this article on the Second Life Wiki. Technical wording and examples are retained from the source; historical guidance may differ from current behavior.