Posts: 548
Threads: 35
Joined: Jul 2012
Reputation:
0
I was testing actors, the recent updated. And unfortunately there are few bugs which are annoying:
1. When i shot actor with a DEAGLE, they die instantly.(i haven't tested any other weapon yet, I tried fist it worked well)
2. When actor's health set to 0, they die; But there is no function for spawning them!
Posts: 484
Threads: 49
Joined: Feb 2011
1. Use
https://sampwiki.blast.hk/wiki/SetActorHealth
2. Use
https://sampwiki.blast.hk/wiki/OnPlayerGiveDamageActor to check if actors hp is 0, than destroy actor, recreate, set his health back, applyanimation or whatever you want.
But there is still one problem, OnPlayerGiveDamageActor is not called if you apply animation on actor.
Posts: 484
Threads: 49
Joined: Feb 2011
Set their health to 200hp or so after you create them. Deagle is dealing 70 damage.
Posts: 548
Threads: 35
Joined: Jul 2012
Reputation:
0
And thats wrong. The rest weapons are giving normal damage.
If i set to 200, then how will manage damage from other weapons?
Posts: 484
Threads: 49
Joined: Feb 2011
You can reduce damage dealt by deagle, create you own damage system by reported weapon id in that callback. Don't use amount given by callback.
pawn Код:
new Float:damage;
if(weaponid == 24) damage = 25.0;//deagle
else if(weaponid == 34) damage = 35.0;//sniper
if(weaponid == 24 || weaponid == 34)
{
SetActorHealth(damaged_actorid, helath - damage);
}
else
{
SetActorHealth(damaged_actorid, helath - amount);
}
Posts: 391
Threads: 46
Joined: Mar 2008
Reputation:
0
It looks like, that these are values of damage, which you normally inflict to vehicles with the guns. When you shoot at player or NPC, you inflict only 33% damage compared to car. This was probably unintentional bug and might be fixed in upcoming revision.
Posts: 262
Threads: 26
Joined: Dec 2014
Reputation:
0
set actor health to Float_INFINITY at y_utils:
#define FLOAT_INFINITY (Float:0x7F800000)
lol
Posts: 391
Threads: 46
Joined: Mar 2008
Reputation:
0
Also, I noticed SetActorFacingAngle doesn't update actor's facing angle, until the actor is restreamed for player.