IwIsPlusUser

From InWorldz Wiki
Jump to: navigation, search

Scripting Wiki

InWorldz Functions | LSL Functions | Bot / NPC Functions | Events | Bot Events | Types | Operators | Constants | Flow Control | Glossary

function: integer iwIsPlusUser(key user);

Returns a non-zero value if the specified user key is a Plus user, eligible for additional perks.

Arguments
key user = The key of the avatar in question.
Returns
integer a numeric result code which indicates whether the user is a Plus user or not. Returns FALSE or TRUE.


Important Notes

  • This function provides a simplified test for vendors, access devices, and anything else that may want to add a perk specific to Plus accounts.
  • This is the primary method for testing whether an avatar user is a Plus account, and the only test that should be used by scripts.



Important Issues - View All - Search Mantis for related Bugs


Examples

A quick example:

default
{
   touch_start(integer num)
   {
       // Test whoever clicked on this object to see if they are a Plus user.
       key who = llDetectedKey(0);
       string name = llDetectedName(0);
       if (iwIsPlusUser(who))
           llSay(0, name+", you are a Plus user.");
       else
           llSay(0, "Sorry "+name+", you are not a Plus user.");
   }
}

General Notes

  • This function consolidates and simplifies the tests for all the possible avatar account types, sorting them into whether they represent a Plus-eligible user account or not.
  • For display purposes, iwGetAgentData(who, DATA_ACCOUNT_TYPE) can be used to fetch the text string itself, but this text should only be used for cosmetic purposes, not tested for specific values in any script logic.
  • For those who prefer using a dataserver event, llRequestAgentData(who, DATA_ACCOUNT_TYPE) can also be used to fetch the same text.

See Also

Functions
llRequestAgentData
iwGetAgentData