SA-MP Forums Archive
Actors BUGs! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Actors BUGs! (/showthread.php?tid=572713)



Actors BUGs! - Excel™ - 01.05.2015

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!


Re: Actors BUGs! - Dragony92 - 01.05.2015

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.


Re: Actors BUGs! - Excel™ - 01.05.2015

https://sampwiki.blast.hk/wiki/OnPlayerGiveDamageActor, thats the only way of detecting and thats where i just performed
pawn Код:
SetActorHealth(damaged_actorid, helath - amount);
But DEAGLE gives one shot one kill!


Re: Actors BUGs! - Dragony92 - 01.05.2015

Set their health to 200hp or so after you create them. Deagle is dealing 70 damage.


Re: Actors BUGs! - Excel™ - 01.05.2015

And thats wrong. The rest weapons are giving normal damage.

If i set to 200, then how will manage damage from other weapons?


Re: Actors BUGs! - Dragony92 - 01.05.2015

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);
}



Re: Actors BUGs! - Gammix - 01.05.2015

Actually not deagle only; Here is a list of damage done by each weaponnot all) Actually, i think all of them are wrong.(according to weapons.dat)

Its not hard to code a custom damage system(i have been working on it in PEDS.inc) but time consuming and hard to structure an absolute and accurate damage system. You have to take care of damage, range, height, and maybe bodyparts.


Re: Actors BUGs! - niCe - 01.05.2015

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.


Re: Actors BUGs! - RaeF - 01.05.2015

set actor health to Float_INFINITY at y_utils:
#define FLOAT_INFINITY (Float:0x7F800000)

lol


Re: Actors BUGs! - niCe - 03.05.2015

Also, I noticed SetActorFacingAngle doesn't update actor's facing angle, until the actor is restreamed for player.