Difference between revisions of "User expirePoints"

From Catglobe Wiki
Jump to: navigation, search
(Arguments)
(Example)
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:
 
= User_expirePoints =
 
= User_expirePoints =
  
 +
Expire all points of given users before the given time
  
 
== Syntax ==
 
== Syntax ==
  
User_expirePoints(array userResourceId, CGDateTime expireAllBefore, string Description[, Boolean Test]);
+
User_expirePoints(array userResourceId, DateTime expireAllBefore, string Description[, Boolean Test]);
  
 
== Arguments ==
 
== Arguments ==
Line 19: Line 20:
  
 
<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>
 +
[[File:2019-11-22_17-17-34.png|1200px]]

Latest revision as of 11:22, 22 November 2019

User_expirePoints

Expire all points of given users before the given time

Syntax

User_expirePoints(array userResourceId, DateTime 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}

2019-11-22 17-17-34.png