Scripting Issue [With Money Costs]
#1

Hey Guys,

Anyone know if I've coded this wrong?

pawn Код:
new vipcost;
vipcost = GetVehiclePrice(idcar) / 15;
GivePlayerMoney(playerid,-vipcost);
How would I make it say something like, VIPCOST = Price of car - 15%.

I've tested that above and it doesn't work, thanks.
Reply
#2

As far as I see, the code is right, but that's not 15%.
You see, you're currently dividing the price on 15, it's like 1/15 = 0.066666 off.

You probably missed the difference from the money because they didn't give you -0.06666 so to remove 15% you need to calculate it right.
Reply
#3

pawn Код:
new vipcost = floatround(GetVehiclePrice(idcar) * 0.85);
GivePlayerMoney(playerid,-vipcost);
Use floatround as giveplayermoney need an integer value.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)