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 534 times)

0 Members and 1 Guest are viewing this topic.

Offline Ming

  • Jr. Member
  • **
  • Posts: 45
  • Gender: Male
  • yee yep ass haircut
    • 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: 47
  • 中国!中国!中国!
    • 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: 262
  • 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

  • Jr. Member
  • **
  • Posts: 45
  • Gender: Male
  • yee yep ass haircut
    • View Profile
Re: Ped has been hurt or not
« Reply #3 on: July 05, 2021, 03:37:09 PM »
Thanks a lot

Offline Ming

  • Jr. Member
  • **
  • Posts: 45
  • Gender: Male
  • yee yep ass haircut
    • 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

  • Jr. Member
  • **
  • Posts: 39
  • Gender: Male
  • lack of source, lack of innovation.
    • 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

  • Jr. Member
  • **
  • Posts: 45
  • Gender: Male
  • yee yep ass haircut
    • 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 👍