Anti theft code: Difference between revisions

From Whirled Club Wiki
Jump to navigation Jump to search
(Created page with "<actionscript> // The numbers in your whitelist are player IDs that may wear the avatar // You can get your player ID by looking at the number in the URL of your profile...")
 
(Replaced content with "To be fixed")
Tag: Replaced
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
&lt;actionscript&gt;
To be fixed
// The numbers in your whitelist are player IDs that may wear the avatar
// You can get your player ID by looking at the number in the URL of your profile
var whitelist :Array = [
    9001, // Replace with your player ID
    878, // Add more for friends who can also wear this avatar
]
if (_ctrl.getEnvironment() != EntityControl.ENV_VIEWER &amp;&amp; whitelist.indexOf(_ctrl.getEntityProperty(EntityControl.PROP_MEMBER_ID)) &lt; 0) {
    this.root.visible = false;
    _ctrl.registerActions(&quot;This avatar is restricted to &quot; + whitelist, &quot;Contact the seller if you bought this avatar&quot;);
    _ctrl.registerStates();
    _ctrl.registerCustomConfig(null);
    _ctrl.registerPropertyProvider(null);
}
&lt;/actionscript&gt;
 
Don't forget to import com.whirled.EntityControl and set up your _ctrl object. This should also work with pets, if you remove the calls to registerStates and registerActions.
 
Aduros sez: I haven't fully tested this, so send me a mail if it doesn't work!

Latest revision as of 16:59, 25 August 2018

To be fixed