Jump to content

How to create a Rank-Points system for Race


Mario222

Recommended Posts

I need a Rank-Points system that can be displayed on the scoreboard for a server with maps of Race and DD-DM-Shooter. Composed as follow.

Number 1 - Win 20 Points.

Number 2 - Win 10 Points.

Number 3 - Win 5 Points.

Number 4 to down - 2 Points.

And the number of rank based on the number of existing accounts and who have more rank based on his points, and the one who has more points the higher his rank will be the largest being the number 1. 

 

Link to comment

Hello Mario222,

since you have asked in your title about "how to create" such a system, I want to give you basic hints about useful functions of MTA and Lua in general.

  • You can use the table.sort Lua table library function to put table entries into a point-based order. This function can receive a table of tables as input and then sort based on an item key, for example the points of a player.
  • The wiki documentation for the MTA:SA race resource is the go-to location for details about the events and functions when creating add-ons for it. I think that the "onPlayerFinish" event is of interest to you. By using its rank parameter you can design a mathmatical point-distribution function based on finish-positions.
  • I recommend you to use a fixed table of points for a each player finish-position. When you are more advanced in mathematics you wouldn't be asking this question, right? But you could give it an exponential decrease based on a higher first-position score depending on the player count. This detail is up to you, in other words I won't be providing you with the advanced solution for nothing.
Edited by The_GTA
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...