14.06.2009, 05:53
K so I'm not really new to scripting however I'm not the best.
I'm editing the GF script just for practice and this is part of the car jacker job when a person brings a car back to the drop off this is what figures their money.
Basically I want the script to find out how much HP the car has, then take the max they can earn for level 1 and divide it by how much HP the car has (Say the car has 1000 HP so it would take 5000 / 1000 = Div)
Then I want it to take the max price of the car and subtract the damage that's been done to it (5000 - div [Which in this case is 5] + 5 [For the 5 that it is off from the 5000/1000])
So the pay out price in this scenario would be $5,000.
But in the game it's only giving me $5
Help?
I'm editing the GF script just for practice and this is part of the car jacker job when a person brings a car back to the drop off this is what figures their money.
Basically I want the script to find out how much HP the car has, then take the max they can earn for level 1 and divide it by how much HP the car has (Say the car has 1000 HP so it would take 5000 / 1000 = Div)
Then I want it to take the max price of the car and subtract the damage that's been done to it (5000 - div [Which in this case is 5] + 5 [For the 5 that it is off from the 5000/1000])
So the pay out price in this scenario would be $5,000.
But in the game it's only giving me $5
Help?
Код:
new veh = GetPlayerVehicleID(playerid); new Float:health; new HP = GetVehicleHealth(veh, health); new Div = 5000 / HP; new price = 5000 - Div + 5; format(string, sizeof(string), "You sold a car for $%d, your reload time is 20 minutes.", price); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); GivePlayerMoney(playerid, price); PlayerInfo[playerid][pCarTime] = 0;