ID:1083933
 
(See the best response by NNAAAAHH.)
I've tried finding more information about this, but I can't seem to find any topic with what I want.

In the reference for CheckPassport() it mentions "If the user is subscribed, the result is the number of days left (rounded up) on their subscription, or -1 for lifetime subscribers."

So, with that in mind, I am wondering if my code can check that number, and update my own vars based off whether the number equals (for example only), 30, 60, or -1 and such?

As you may be able to guess, I am wondering this because if that is possible I can reward people differently based off the duration of the subscription they bought. I'd find that incredibly valuable, in some cases.

I'm asking this for future reference, since it'll be important when I get to the release phase on a project.

Best response
var/num = client.CheckPassport()
if(!num) return //if no subscription found, return
if(num<0)//You can either use this or == -1, not sure if one is more efficient or not
mob.FullRewards()//Give the mob full rewards(define your own proc) if found to have a lifetime subscription.
if(num>10)
mob.Reward1()
if(num>20)
mob.Reward2()
ect, ect.
OR
var/num = client.CheckPassport()
for(1 to num)//could be a while() loop, not sure what this would do for -1.
mob.stat++//add to a stat for each day they subscribed
mob.money++//add to their cash aswell
//Around this part you might want to assign a variable with the num to the mob to ensure they don't get the boost again
src<<"You've gained [num] of [statname] and [moneyname]."
Ah, wow. I didn't expect it to be that simple, heck I was worried it wouldn't even be possible. Thanks!
In response to NNAAAAHH
For the question regarding for(var/i in 1 to -1), it will not iterate. You'll have to handle -1 differently.

PS: The proper syntax is
for(var/i in i_initial to i_final step i_step)

If step is removed, i_step will default to 1.
In response to Jemai1
I figured as such, thanks for clarification.