Difference between revisions of "User:Daemonika Nightfire/Scripts/Anti copy trans"

From Second Life Wiki
Jump to navigation Jump to search
(Created page with "==*DS* Anti (copy & transfer)== This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission. Additionally the s…")
 
m (<lsl> tag to <source>)
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
==*DS* Anti (copy & transfer)==
==*DS* Anti (copy & transfer)==
This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission.
This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission.
Additionally the script will delete itself when the customer of the reseller receives it with both permissions. Because it is a global funkcion, it can be used universally.
Additionally the script will delete itself when the customer of the reseller receives it with both permissions. Because it is a global function, it can be used universally.


  Make sure that you not give away scripts with modify rights which contains this function.
  Make sure that you not give away scripts with modify rights which contains this function.


<lsl>
<source lang="lsl2">
/*
/*
     ╔═════════════════════════════════════−−−­­­­­­→
     ╔═════════════════════════════════════−−−­­­­­­→
Line 88: Line 88:
     }
     }
}
}
</lsl>
</source>

Latest revision as of 18:17, 24 January 2015

*DS* Anti (copy & transfer)

This funktion allows you to give away scripts with copy & transfer permissions and force the reseller to change the permission. Additionally the script will delete itself when the customer of the reseller receives it with both permissions. Because it is a global function, it can be used universally.

Make sure that you not give away scripts with modify rights which contains this function.
/*
    ╔═════════════════════════════════════−−−­­­­­­→
    ║ *DS* Anti (copy & transfer) © by Daemonika Nightfire (daemonika.nightfire)
    ╚══════════════════════−−−­­­→
*/

// stored key's (UUID) of creator and reseller
list CreatorKey = ["61ee201a-81cf-4322-b9a8-a5eb8da777c2","00000000-0000-0000-0000-000000000000"]; // expandable

////////// global function \\\\\\\\\\
CorrectPerms?()
{
    string Script = llGetScriptName(); // ask for scriptname
    llSetText("", ZERO_VECTOR, 0.0); // clear floatingtext
    
    // compares the ownerkey with the key's in the list
    if(llListFindList(CreatorKey, llCSV2List(llGetOwner())) == -1)
    {
        // if the ownerkey don't match, the script will delete itself when permission copy & tranfer is given
        integer MaskOwner = llGetInventoryPermMask(Script, MASK_OWNER);
        if((MaskOwner & PERM_TRANSFER) && (MaskOwner & PERM_COPY) != 0)
        {
            llOwnerSay("/me " + Script + ": Sorry, i was not made for you. Goodbye");
            llRemoveInventory(Script);
        }
    }
    
    // force the reseller to set (no copy) or (no trans), otherwise the script will not work
    integer MaskNext = llGetInventoryPermMask(Script, MASK_NEXT);
    if((MaskNext & PERM_TRANSFER) && (MaskNext & PERM_COPY) != 0)
    {
        llSetText("please correct the script-permission to:\n(copy/no transfer) or (no copy/transfer)", <1,1,0>, 1.0);
        state Offline;
    }
}

default
{
    state_entry()
    {
        CorrectPerms?(); // starts the global function
    }

    touch_start(integer total_number) // just for show that it work
    {
        llSay(0, "Yay, script-permission correct.");
    }
    
    changed(integer change)
    {
        if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
        {
            llResetScript();
        }
    }
    
    on_rez(integer Dae)
    {
        llResetScript();
    }
}

state Offline
{
    state_entry()
    {
        llOwnerSay("Sorry, please correct the script-permission");
    }
    
    changed(integer change)
    {
        if(change & (CHANGED_OWNER|CHANGED_INVENTORY))
        {
            llResetScript();
        }
    }
    
    on_rez(integer Dae)
    {
        llResetScript();
    }
}