Anti theft code

From Whirled Club Wiki
Revision as of 16:58, 25 August 2018 by Dragawn (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

<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 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 && whitelist.indexOf(_ctrl.getEntityProperty(EntityControl.PROP_MEMBER_ID)) < 0) {

   this.root.visible = false;
   _ctrl.registerActions("This avatar is restricted to " + whitelist, "Contact the seller if you bought this avatar");
   _ctrl.registerStates();
   _ctrl.registerCustomConfig(null);
   _ctrl.registerPropertyProvider(null);

} </actionscript>

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!