Open IstuntmanI opened 7 years ago
Well this limit vehicle's health to 999 instead of 1000, because this is what is uses to determine when the player really get resprayed. This instead uses the player camera I think: http://forum.sa-mp.com/showthread.php?t=490436 rt-2
Well, the maximum health will be lower with only 1 unit (not even), why does it matter ? It could also help to detect cheaters. (vehicle health bigger than 999.98 => ban ?) The detection from that include is interesting.
I personally have vehicles with more than 1000, so this methods is not good for me. We should not modify the behaviors normally isn't that right? The camera method works perfectly and vehicles have the real health, that's what I'm using.
You are right. Well, we should use that method then, if it really works correctly.
Been using it for some time now, in fact the complete package is very neat you should try it. And it calls another new function and doesn't disrupt the fact that OnVehicleRespray is not called at Pay'n'Sprays, it calls
OnPlayerUseGarage(playerid, vehicleid, type)
Description: Called when a player uses a Pay'n'Spray or bomb shop.
instead. rt-2
Such a shame that thread got burried under all the other includes. It has some very useful callbacks.
OnVehicleRespray isn't called for Pay'n'Sprays.
This is written on the wiki too: http://wiki.sa-mp.com/wiki/OnVehicleRespray http://wiki.sa-mp.com/wiki/Bugs
CreateVehicle
andAddStaticVehicle(Ex)
and set their health to999.8
(well, as close to1000.0
as possible, but not1000.0
, without having problems with rounding from the storage of floats). Also hookRepairVehicle
andSetVehicleHealth
, if the set health is above1000.0
(the first function does that automatically) set the health to999.8
too, so the player won't be false detected while entering in the area of a Pay'n'Spray. By the way, I don't get why he created that array underOnPlayerUpdate
as long as it isn'tstatic
.