Help actor dynamic
#4

Quote:
Originally Posted by TMapping
Посмотреть сообщение
Actors do not -hp
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
PHP код:
CreateDynamicActor(modelidFloat:xFloat:yFloat:zFloat:rinvulnerable 1Float:health 100.0worldid = -1interiorid = -1playerid = -1Float:streamdistance STREAMER_ACTOR_SDareaid STREAMER_TAG_AREA -1priority 0);
/*That invulnerable should be set to 0 in case of taking dmg*/
//or even 
SetDynamicActorInvulnerable(actorid0); 

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(actorid0);
        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;

Reply


Messages In This Thread
Help actor dynamic - by TMapping - 17.10.2018, 08:59
Re: Help actor dynamic - by khRamin78 - 17.10.2018, 17:13
Re: Help actor dynamic - by TMapping - 17.10.2018, 20:45
Re: Help actor dynamic - by khRamin78 - 17.10.2018, 21:18

Forum Jump:


Users browsing this thread: 2 Guest(s)