OsGrantScriptPermissions

De DigiWiki.

(Différences entre les versions)
Djphil (discuter | contributions)
(Page créée avec « void osGrantScriptPermissions(key allowed_key, string function). <br /> Dynamically allow ossl execution to owner/creator/group by function name. <lsl> list functions = ["os… »)
Modification suivante →

Version du 6 mai 2015 à 03:28

void osGrantScriptPermissions(key allowed_key, string function).
Dynamically allow ossl execution to owner/creator/group by function name.

list functions = ["osNpcCreate", "osNpcGetPos", "osNpcLoadAppearance", "osNpcGetRot", "osNpcMoveTo",
                "osNpcRemove", "osNpcSaveAppearance", "osNpcSay", "osNpcSetRot","osNpcSit", "osNpcStand",
                "osNpcPlayAnimation", "osNpcStopAnimation","osNpcMoveToTarget", "osNpcStopMoveToTarget",
                "osOwnerSaveAppearance", "osAgentSaveAppearance"];
 
default
{
    state_entry()
    {
        llSetColor(<1,0,0>,ALL_SIDES);
    }
 
    touch_start(integer det)
    {
        llSay(0, "Enable");
 
        osGrantScriptPermissions(llGetOwner(), functions);  
        state enabled;
    }
}
 
state enabled
{
    state_entry()
    {
        llSetColor(<0,1,0>,ALL_SIDES);
        llSay(0, "ossl functions enabled");
    }
 
    touch_start(integer det)
    {
        osRevokeScriptPermissions(llGetOwner(), functions);
        state default;
    }
}

This example will allow the owner of this object to create and manipulate NPCs. To allow other possibilities, change the llGetOwner() to any key for another avatar or group.

Outils personnels
donate
Google Ads