• Resolved novikser

    (@novikser)


    Hi all!!

    I need to help with this topic. If two players scored 4 goals but has a different total games – they indicate at top who played more games. its not correct… at first position must be player who played less games

    some ideas?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor Roch

    (@rochesterj)

    Hi there!

    Thanks for your message, it’s great to see you again.

    Just to make sure we get to the right solution, is this always going to be the case?

    So if you have two players with the same amount of goals, will always the player with fewer games come first?

    Also, do you know the maximum size of your goals variable? I mean, how many goals does the top scorer has? 10, 100, 1000?

    Just so we can adjust our “hack” to make sure it works for you (you’ll understand what I mean when you see the solution).

    Thanks!

    Thread Starter novikser

    (@novikser)

    Yes @rochesterj – its normal rules for indicate top scorers..

    as like laliga – https://www.laliga.com/en-GB/stats (look – 4 players scored 11 goals)

    at one seasons best scorer in Ukraine can scored in 30-40 goals.

    Plugin Contributor Roch

    (@rochesterj)

    Hi!

    Alright then.

    The main issue here is that player lists can only be ordered by one attribute. Thus we need to create a new rule to encompass both stats.

    And the trick is using math.

    You’ll add a new stat (it can be hidden in your player profiles), something like goalsindex. It’s formula should be something like this:
    goals * 1000 - eventsplayed

    This rule ensures that players with most goals will come first. But if they have more events they will come after.

    For example:
    John – 3 goals 1 game
    Paul – 3 goals 3 games
    George – 2 goals 1 game

    Now when we evaluate the rule, we get this:
    John = 3 * 1000 – 1 = 2999
    Paul = 3 * 1000 – 3 = 2997
    George = 2 * 1000 – 1 = 1999

    Let me know how it works for you.

    Thanks!

    Kind Regards,
    -Roch

    Plugin Contributor Roch

    (@rochesterj)

    HI there

    I’m wondering if this one worked for you.

    Let us know if you need anything else.

    Thanks!

    Thread Starter novikser

    (@novikser)

    Hi @rochesterj
    Not yet… i will try and write late. Now have some problems with content…
    Keep in touch!

    Plugin Contributor Roch

    (@rochesterj)

    Hi!

    Alright then!

    If you need any help with that just let us know.

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Best scorers. Sort by goals and matches’ is closed to new replies.