Welcome, Please Register or Login

Forums \ Street Legal Racing \ F.A.Q / Help Section \ I need help from best programmers! CarMarket.java + player.car HP

Author Message
#1\2018-03-29 14:08

Avatar

Members
2
Offline

Posts: 5


00

Formula: price *= power/100; (example: price*1.5)
But i can't take the HP((( HP value of my car always 0

http://imagehost.cc/image/2dJcC


Added 2 hours later:

LOL! I did it!
It's must looks like this
if(used && curcar == 0)
			{
				int power = ce.getHP(cars[curcar]);
				price *= 1.0+((cars[curcar].getPrestigeMultiplier()-1.0)*PRESTIGE_RATIO_BUY);
				//price *= PRICERATIO_BUY;
				carName.changeText("YOUR CAR  $" + price + "  POWER " + power + "HP");
			}

This post was edited by PraydE (2018-03-29 15:41, 3 weeks ago)
#2\2018-03-29 16:10

Administrator
9
Offline

Posts: 693

Saxony
de Germany

okay but would it do? put the hp of an car at cardealer up?
if yes.. it is a bit senseless.. because tuning and stuff ;-)
#3\2018-03-29 17:37

Forum Moderator
5
Offline

Posts: 1384


pt Portugal

you are using the wrong formula to get the car HP, the getHP() formula you need to insert a rpm inside the (), to get the max hp you need to do it like the CarInfo
and use dyno.maxHP