Jump to content

Calculate money from a number.


Pirulax

Recommended Posts

  • Discord Moderators

Okey, so, i have this: Picture 

I hope you got it.I want to calculate the amount of money, but i cant find any working idea...  Btw, u need to use the width, which is: 0 - left side 5 - center 10 - right side. Isnt the most accurect example, but i hope u got the idea.

btw, its for a minigame.

Edited by Pirulax
Link to comment
  • Discord Moderators
1 minute ago, Dretax said:

How long is that box? (MTA site)

 

7 minutes ago, Pirulax said:

0 - left side 5 - center 10 - right

Btw, its 500 px width.

I think i found it.

if value < 5 then
  minigame.TotalMoney = (200000 * 5) / value - 100000
elseif value > 5 then
  minigame.TotalMoney = (200000 / 5) * (value-5) + 100000
end

Just reversed the first one xdd

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...