User withdrawPoints

From Catglobe Wiki
Jump to: navigation, search



User_withdrawPoints

Withdraw a number of points from a user

Syntax

  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction") - Remove points from user of current QAS. Returns 0 if count not withdraw the necessary amount.
  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction", int userResourceId "Resource Id of user that gets the points") - Remove custom points from user. Returns 0 if count not withdraw the necessary amount.
  • int User_withdrawPoints(int points "Number of points to remove", string description "User visible log entry associated with the transaction", int userResourceId "Resource Id of user that gets the points", int customType "Store custom transaction type. Can be 1-127, or 0 for ManualTransaction") - Remove custom points from user. Returns 0 if count not withdraw the necessary amount.

Arguments

  • points: is a number expression. It is the number of points to withdraw
  • description: is a string expression. It is the transaction's description
  • userResourceId: is a number expression. It is the user's resource id

Return value

A number, if the process succeeds, return 0, return the number of points otherwise

Example

number p = User_withdrawPoints(120, "Withdraw", 456546);

//return 0 or the number of withdrawn points

Availability

Version 5.6