Jump to content
McKay Development

Get player steam level with color


EaGLE
 Share

Recommended Posts

client.getSteamLevels([steamID], function (results) {
            var lvl = results % 100;
            if (lvl >= 0 && lvl <= 9) {
                gray
            } else if (lvl >= 10 && lvl <= 19) {
                red
            } else if (lvl >= 20 && lvl <= 29) {
                orange
            } else if (lvl >= 30 && lvl <= 39) {
                yellow
            } else if (lvl >= 40 && lvl <= 49) {
                green
            } else if (lvl >= 50 && lvl <= 59) {
                blue
            } else if (lvl >= 60 && lvl <= 69) {
                purple
            } else if (lvl >= 70 && lvl <= 79) {
                pink
            } else if (lvl >= 80 && lvl <= 89) {
                idk
            } else if (lvl >= 90 && lvl <= 99) {
                idk
            }
        }

 

Link to comment
Share on other sites

                       //    0         10        20            30            40          50        60         70      80           90    
    let colors = ["Gray""Red""Orange""Yellow""Green""Blue""Lilac""Pink""Cherry""Brown"];
 
    client.on("friendMessage", (SENDERMSG=> {
        client.getSteamLevels([SENDER], (ERRCURRENTLEVEL=> {
            if (!ERR) {
                console.log("The color of your level is " + colors[Math.floor(CURRENTLEVEL[SENDER] % 100 / 10)]);
            }
        });
    });
Link to comment
Share on other sites

1 hour ago, PonyExpress said:
                       //    0         10        20            30            40          50        60         70      80           90    
    let colors = ["Gray""Red""Orange""Yellow""Green""Blue""Lilac""Pink""Cherry""Brown"];
 
    client.on("friendMessage", (SENDERMSG=> {
        client.getSteamLevels([SENDER], (ERRCURRENTLEVEL=> {
            if (!ERR) {
                console.log("The color of your level is " + colors[Math.floor(CURRENTLEVEL[SENDER] % 100 / 10)]);
            }
        });
    });

can you explain it..please? i do not know what kind of api or package you are using or what does the code mean

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...