Bully-Board
Bully Modding Section => Modding Questions/Help => Topic started by: Ming on June 17, 2021, 07:46:11 AM
-
I need a function to judge Ped has been hurt or not,can someone help?
-
PedIsPlaying(ped, "/Global/HitTree", true)
-
Alternatively, PedIsHit(PedName).
-
Thanks a lot
-
Alternatively, PedIsHit(PedName).
Does the VehicleIsHit() function exist?
-
Alternatively, PedIsHit(PedName).
Does the VehicleIsHit() function exist?
No, but you can use CarGetDamageNumber(VEHICLE_NAME). It returns a number of how many times the vehicle got hit.
Example of use:
if VehicleIsValid(CAR) and CarGetDamageNumber(CAR) >= 1 then
TextPrintString("Car got hit!\nCounts: "..CarGetDamageNumber(CAR), 4, 1)
end
I never test it to any vehicle other than car, but you can try it.
-
Alternatively, PedIsHit(PedName).
Does the VehicleIsHit() function exist?
No, but you can use CarGetDamageNumber(VEHICLE_NAME). It returns a number of how many times the vehicle got hit.
Example of use:
if VehicleIsValid(CAR) and CarGetDamageNumber(CAR) >= 1 then
TextPrintString("Car got hit!\nCounts: "..CarGetDamageNumber(CAR), 4, 1)
end
I never test it to any vehicle other than car, but you can try it.
Thanks for your help 👍