LlAllowInventoryDrop

De DigiWiki.

When llAllowInventoryDrop is set to TRUE, the event that occurs is:

 changed(integer change) {
        if (change & CHANGED_ALLOWED_DROP) { 
	llSay(0, "Your contribution is appreciated, o ye non-permitted modifier!");
 
        }
    }

When llAllowInventoryDrop is set to FALSE, the event that occurs is:

 changed(integer change) {
        if (change & CHANGED_INVENTORY) { 
	llSay(0, "Your contribution is appreciated, o ye permitted modifier!");
 
        }
    }

Tip! To test for either changed event, the proper syntax is:

changed(integer change) {
    if ((change & (CHANGED_ALLOWED_DROP | CHANGED_INVENTORY)) ) {
      llSay(0, "yeppers, inventory changed somehow.");
    }
}

The following example is a bit elaborate. It illustrates alternating AllowInventoryDrop off and on. (This is likely not something you would actually do unless you really wanted to play with users' minds.)

integer allow;
 
default
{
    touch_start(integer num)
    {
        llAllowInventoryDrop(allow = !allow);
        llOwnerSay("llAllowInventoryDrop == "+llList2String(["FALSE","TRUE"],allow));
    }
    changed(integer change)
    {
        if (change & CHANGED_ALLOWED_DROP) //note that it's & and not &&... it's bitwise!
        {
            llOwnerSay("The inventory has changed as a result of a user without mod permissions dropping 
                        an item on the prim and it being allowed by the script.");
        }
    }
}
Outils personnels
  • Cette page a été consultée 564 fois.
donate
Google Ads