17.10.2018, 08:59
Hi, why do not my actor ever change his mind and start firing his HP?
PHP код:
hook OnPlayerUpdate(playerid)
{
new actorid = GetPlayerTargetDynamicActor(playerid);
if(actorid == INVALID_ACTOR_ID) return 1;
if(IsValidDynamicActor(STREAMER_TAG_ACTOR actorid) && GetPlayerWeapon(playerid) != 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;
}