Hello There, Guest! Login or Register


Vehicle crashing - Health loss
#1
After recently completing my speedometer ticket, I just wrote out a ticket for the vehicle crashes health loss system. However, I have come to realize before assigning it to myself that it may not be the best idea.

The original idea (discussed here) was said that it should be detected by vehicle health decreases. However, what if a deathmatcher starts shooting the car? How can we tell the difference between a health decrease in a crash and somebody shooting it?

Reply
#2
That's simple. Just check if a another player is 0 to 100 meters from the car, calculate his angle and compare it with the car's position and check if the player's ammo decreases. If this is not the case, the car has just crashed >:) :P

Anyway, that's pretty difficult to check indeed.
Reply
#3
That wouldn't bee 100% fall proof tbh. Somebody could be driving towards two players in the middle of a fight constantly shooting and switching angles to avoid the bullets and then crash into them, well, run them over.

Another idea I just had is using the speedometers functions, maybe we could check for sudden speed decreases as-well as health decreases. That might not always work either though since it's not 100% accurate.
Reply
#4
(08-30-2008, 12:16 AM)Badeend link Wrote: That's simple. Just check if a another player is 0 to 100 meters from the car, calculate his angle and compare it with the car's position and check if the player's ammo decreases. If this is not the case, the car has just crashed >:) :P

That must be a joke. :+

I'm not entirely sure. I guess some flying bullets hitting a car could hit the driver, so if you damage the car 10 units, the driver loses 1 unit of health? Meaning if you rape a car into a flames the driver will die, meh.

This wouldn't be that smooth in my opinion.
Reply
#5
You can't just check if the vehicle has come into contact with another object? Then check the loss of speed and calculate the ammount of health the player should lose?
Reply
#6
Nope, not possible in SA:MP. There's no functions to detect any collisions of any kind.
Reply
#7
Well then this will just have to wait for 3.0  ;)
Reply
#8
if there is a 3.0 =/
Reply
#9
Unless we use the new speedometer system to calculate the difference in speed when a vehicle's health changes. The more it is and the more vehicle health is lost, the more health the player loses?
Reply
#10
Right, thought about it. We'll just work out the highest amount of vehicle health that can be decreased using a weapon (Discluding rocket launchers and stuff because they instantly explode the car and kill any players inside it anyway) and only detect vehicle crashes if the health decrease is more than what that weapon caused, which is more realistic anyway, since in real life you don't hurt yourself from little car crashes anyway, only big ones.
Reply