Bully-Board

Bully Modding Section => Modding Questions/Help => Topic started by: Ming on June 17, 2021, 07:46:11 AM

Title: Ped has been hurt or not
Post 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?
Title: Re: Ped has been hurt or not
Post by: mhdt on June 21, 2021, 02:16:47 AM
PedIsPlaying(ped, "/Global/HitTree", true)
Title: Re: Ped has been hurt or not
Post by: SimonBestia on June 21, 2021, 04:45:56 PM
Alternatively, PedIsHit(PedName).
Title: Re: Ped has been hurt or not
Post by: Ming on July 05, 2021, 03:37:09 PM
Thanks a lot
Title: Re: Ped has been hurt or not
Post by: Ming on August 02, 2021, 04:52:08 AM
Alternatively, PedIsHit(PedName).
Does the VehicleIsHit() function exist?
Title: Re: Ped has been hurt or not
Post by: Altamurenza on August 02, 2021, 06:52:33 AM
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:
Code: [Select]
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.
Title: Re: Ped has been hurt or not
Post by: Ming on August 02, 2021, 08:14:16 AM
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:
Code: [Select]
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 👍