Hp of attached objects?
#1

Hello guys.
I ask a question. Not really a problem but i have to know before starting a script.

I know we can put Hp to a object with Var. But we can put Hp to a attached object?

Thank you for your support <3
Reply
#2

I have no idea what you mean by "HP to a var"? Objects don't have health in SA-MP, unless I'm misunderstanding what you're saying.
Reply
#3

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I have no idea what you mean by "HP to a var"? Objects don't have health in SA-MP, unless I'm misunderstanding what you're saying.
Is Player near object tree
Is Player anim chainsaw
Set var --
Var = Health
This is a just a varriable for a normal object but i wanna know if it is possible for a attached object. Now you understand what i mean ?
Reply
#4

Objects attached with SetPlayerAttachedObject have no collision, so OnPlayerWeaponShot won't get called. I'm not sure about attached global/per-player objects.

However, you can still do some not-so-precise checks whether a player shot an object or not based on the offset reported in OnPlayerWeaponShot and some calculations
Reply
#5

Quote:
Originally Posted by Spmn
Посмотреть сообщение
Objects attached with SetPlayerAttachedObject have no collision, so OnPlayerWeaponShot won't get called. I'm not sure about attached global/per-player objects.

However, you can still do some not-so-precise checks whether a player shot an object or not based on the offset reported in OnPlayerWeaponShot and some calculations
I think he's trying to detect with a chainsaw, so OnPlayerWeaponShot won't work in this instance. I think GetObjectPos (assuming you're using actual objects) returns the correct position even if attached.
Reply
#6

Quote:
Originally Posted by Abagail
Посмотреть сообщение
I think he's trying to detect with a chainsaw, so OnPlayerWeaponShot won't work in this instance. I think GetObjectPos (assuming you're using actual objects) returns the correct position even if attached.
Then he can compare both players' facing angle in OnPlayerTakeDamage. It's dirty and very unprecise, but that's all we've got.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)