SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/08/2017, 08:41 PM   #1
TheArrow
Little Clucker
 
TheArrow's Avatar
 
Join Date: Nov 2014
Posts: 37
Reputation: 11
Default Actors problem

Hi

I have a problem with actors, when I created it and set it vulnerable with 100 HP, he didn't lose life but the callback OnPlayerGiveDynamicActorDamage is called.

His life stays in 100 HP and IsDynamicActorInvulnerable return 0 :

pawn Code:
public OnPlayerGiveDamageDynamicActor(playerid, STREAMER_TAG_ACTOR actorid, Float: amount, weaponid, bodypart)
{

    new actid = GetActorIDFromIG(actorid);

    if(actorInfo[actid][actType] == ACTOR_TYPE_ASSEMBLEUR)
    {
        new Float:aHealth;
        GetDynamicActorHealth(actorid, aHealth);

        SendClientMessageEx(playerid, -1, "%f %f %d", amount, aHealth, IsDynamicActorInvulnerable(actorid)); // Here, aHealth stays in 100HP
        if(!aHealth)
        {
            DestroyDynamicActor(actorInfo[actid][actIDIG]);
            DestroyDynamic3DTextLabel(actorInfo[actid][actLabelName]);
           
            format(sQuery, sizeof(sQuery), "DELETE FROM samp_actors WHERE actID = %d", actid);
            mysql_query(sQuery);
           
            for(new i = 0; i < sizeof(actorInfo[]); i++) {
                actorInfo[actid][actInfo:i] = 0;
            }
        }
    }
    return 1;
}

Thanks
TheArrow is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
problem with actors ShoortyFl Scripting Help 3 24/08/2016 12:31 AM
Actors/Interiors problem. TaylorShade Scripting Help 2 19/11/2015 05:34 PM
Problem with actors Julien Sirasor Server Support 2 17/09/2015 04:40 PM
Actors problem AndreiWow Scripting Help 3 04/09/2015 05:04 PM
Problem Actors norton2 Scripting Help 3 15/05/2015 07:57 AM


All times are GMT. The time now is 03:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.