News: Welcome back to Bullworth! If you haven't already, you will need to reset your password..


Author Topic: Ped has been hurt or not  (Read 2134 times)

0 Members and 1 Guest are viewing this topic.

Offline Ming

  • Full Member
  • ***
  • Posts: 154
  • Gender: Male
  • 抽刀斷水水更流,舉杯消愁愁更愁
    • View Profile
Ped has been hurt or not
« on: June 17, 2021, 07:46:11 AM »
I need a function to judge Ped has been hurt or not,can someone help?

Offline mhdt

  • Jr. Member
  • **
  • Posts: 94
    • View Profile
Re: Ped has been hurt or not
« Reply #1 on: June 21, 2021, 02:16:47 AM »
PedIsPlaying(ped, "/Global/HitTree", true)

Offline SimonBestia

  • Full Member
  • ***
  • Posts: 294
  • Gender: Male
  • Bully-Board's Best Weeb
    • View Profile
    • Youtube Channel
Re: Ped has been hurt or not
« Reply #2 on: June 21, 2021, 04:45:56 PM »
Alternatively, PedIsHit(PedName).

Offline Ming

  • Full Member
  • ***
  • Posts: 154
  • Gender: Male
  • 抽刀斷水水更流,舉杯消愁愁更愁
    • View Profile
Re: Ped has been hurt or not
« Reply #3 on: July 05, 2021, 03:37:09 PM »
Thanks a lot

Offline Ming

  • Full Member
  • ***
  • Posts: 154
  • Gender: Male
  • 抽刀斷水水更流,舉杯消愁愁更愁
    • View Profile
Re: Ped has been hurt or not
« Reply #4 on: August 02, 2021, 04:52:08 AM »
Alternatively, PedIsHit(PedName).
Does the VehicleIsHit() function exist?

Offline Altamurenza

  • Full Member
  • ***
  • Posts: 118
  • Gender: Male
  • I love cheat, unique, realistic, & expansion mod.
    • View Profile
Re: Ped has been hurt or not
« Reply #5 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.

Offline Ming

  • Full Member
  • ***
  • Posts: 154
  • Gender: Male
  • 抽刀斷水水更流,舉杯消愁愁更愁
    • View Profile
Re: Ped has been hurt or not
« Reply #6 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 👍