Difference between revisions of "User expirePoints"

From Catglobe Wiki
Jump to: navigation, search
(Arguments)
(Example)
Line 19: Line 19:
  
 
<source lang="javascript">
 
<source lang="javascript">
 +
//Expire all points before 2019 of 2 given users
 +
//To see how many points will be expired, don't give Test parameter, or set Test = True
 +
DateTime a = new DateTime("2019/1/1");
 +
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", true);
 +
//{"13848": 50, "15498936": 0}
  
 
+
//To make actually expire, set Test to false
 
+
DateTime a = new DateTime("2019/1/1");
 +
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", false);
 +
//{"13848": 50, "15498936": 0}
 
</source>
 
</source>

Revision as of 11:14, 22 November 2019

User_expirePoints

Syntax

User_expirePoints(array userResourceId, CGDateTime expireAllBefore, string Description[, Boolean Test]);

Arguments

  • userResourceId: array of userResourceId
  • expireAllBefore: DateTime class, points will be expired before that time
  • Description: string
  • Test: Boolean, optional default not set is true. If false all points before input time will be expired; if True will return amount expired but doesnt actually expire

Return type

Dictionary (Dictionary of userResourceId, Amount expired)

Example

//Expire all points before 2019 of 2 given users
//To see how many points will be expired, don't give Test parameter, or set Test = True
DateTime a = new DateTime("2019/1/1");
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", true);
//{"13848": 50, "15498936": 0}

//To make actually expire, set Test to false
DateTime a = new DateTime("2019/1/1");
User_expirePoints({13848,15498936}, a , "Expire all point before 2019", false);
//{"13848": 50, "15498936": 0}