Sign In Register

How can we help you today?

Start a new topic
Answered

Leaderboard Sum with limit

Hi

My leaderboard is designed for accumulating plus/minus scores with a lower bound.


ex: assume lower bound is "0",

when a user posts +2, -3, +1, +5, -10 -> results 0

when a user posts -2, -3, -4, -5, +1     -> results 1


Is that possible without cloud code?


Thanks a lot!

Jo


Best Answer
Hey Jo,

If you are using C#, Math.Max(0, score) will give you what you want.
Other languages have similar math functions.

 


Hi Jo, 


I'm not sure if that's possible without some extra code in place but I'll look into this for you and let you know what I find. Have you tried to calculate this on the client side ? You could maybe use a LeaderboardEntriesRequest to get the current logged score for that player and then perform a calculation using the new score before submitting it ?


Thanks,

Liam

Hi


Thanks, I'm trying to get this by client-side code.


Answer
Hey Jo,

If you are using C#, Math.Max(0, score) will give you what you want.
Other languages have similar math functions.

 

Login to post a comment