17.10.2018, 21:18
i told you
they are Invulnerable
you have to set them vulnerable using this links please read them
IsActorOnvulnerable // checking if the actor dmg able
SetActorInvulnerable // set actor dmg able
OnPlayerGiveDamageActor // when a player dmg actor
ANYWAY if you use dynamic actor
your code should be like this to make vulnerable actors
just in case do them when ever you create the actors or if you too lazy to do that then do something like this
Your new code should be like this but its not the best way of slove of the problem you have to just make them vulnerable in where you createed them not in some point :
they are Invulnerable
you have to set them vulnerable using this links please read them
IsActorOnvulnerable // checking if the actor dmg able
SetActorInvulnerable // set actor dmg able
OnPlayerGiveDamageActor // when a player dmg actor
ANYWAY if you use dynamic actor
your code should be like this to make vulnerable actors
PHP код:
CreateDynamicActor(modelid, Float:x, Float:y, Float:z, Float:r, invulnerable = 1, Float:health = 100.0, worldid = -1, interiorid = -1, playerid = -1, Float:streamdistance = STREAMER_ACTOR_SD, areaid = STREAMER_TAG_AREA -1, priority = 0);
/*That invulnerable should be set to 0 in case of taking dmg*/
//or even
SetDynamicActorInvulnerable(actorid, 0);
just in case do them when ever you create the actors or if you too lazy to do that then do something like this
Your new code should be like this but its not the best way of slove of the problem you have to just make them vulnerable in where you createed them not in some point :
PHP код:
hook OnPlayerUpdate(playerid)
{
new actorid = GetPlayerTargetDynamicActor(playerid);
if(actorid == INVALID_ACTOR_ID) return 1;
if(IsValidDynamicActor(STREAMER_TAG_ACTOR actorid) && GetPlayerWeapon(playerid) != 0)
{
SetDynamicActorInvulnerable(actorid, 0);
if(actorid == halloCloun[0])
{
TDtext(playerid, "Pataikei i klouna");
}
if(actorid == halloCloun[1])
{
TDtext(playerid, "Pataikei i klouna");
}
if(actorid == halloCloun[2])
{
TDtext(playerid, "Pataikei i klouna");
}
new Float:halloClounHP[3];
GetDynamicActorHealth(STREAMER_TAG_ACTOR halloCloun[0], halloClounHP[0]);
GetDynamicActorHealth(STREAMER_TAG_ACTOR halloCloun[1], halloClounHP[1]);
GetDynamicActorHealth(STREAMER_TAG_ACTOR halloCloun[2], halloClounHP[2]);
if(halloClounHP[0] < 0)
{
DestroyDynamicActor(STREAMER_TAG_ACTOR halloCloun[0]);
}
if(halloClounHP[1] < 0)
{
DestroyDynamicActor(STREAMER_TAG_ACTOR halloCloun[1]);
}
if(halloClounHP[2] < 0)
{
DestroyDynamicActor(STREAMER_TAG_ACTOR halloCloun[2]);
}
}
return 1;
}