18.03.2010, 10:05
Not really hard to do.
First thing I do when scripting something like this is to break it down into things we know.
1. The pay n spray locations do not move.
2. When a car is sprayed the car health goes back up to 1000.
3. The Player loses $100.
4. The car stays still while being sprayed
You could do a check at every pay n spray to check if a play is within a certain distance, then if they are get the health of the car.
Then if the cars health goes back up to 1000 while they are within that area then they probably used the pay n spray, you could also check if they lose money.
So if they are within that area, their car has healed and they have lost $100 give the business $100.
First thing I do when scripting something like this is to break it down into things we know.
1. The pay n spray locations do not move.
2. When a car is sprayed the car health goes back up to 1000.
3. The Player loses $100.
4. The car stays still while being sprayed
You could do a check at every pay n spray to check if a play is within a certain distance, then if they are get the health of the car.
Then if the cars health goes back up to 1000 while they are within that area then they probably used the pay n spray, you could also check if they lose money.
So if they are within that area, their car has healed and they have lost $100 give the business $100.