OnPlayerWeaponShot - BULLET_HIT_TYPE_OBJECT - Object Stream
#1

Hello,

I tried to do:

pawn Code:
forward OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ);
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(hittype == BULLET_HIT_TYPE_OBJECT)
    {
        if(IsValidObject(hitid))
        {
            DestroyDynamicObject(hitid);
        }
    }
   
    return 1;
}
It's impossible to destroy dynamic object ? I mean impossible to detect ?
Thanks
Reply
#2

You'll have to wait until the streamer is updated.
Reply
#3

Thanks pds2k12 and BigETI later <3, I suppose this would work.

pawn Code:
public OnShootDynamicObject(playerid, weaponid, objectid, Float:fX, Float:fY, Float:fZ)
{
    new
        Float:ObjectPos[3], string[ 90 ];
    GetDynamicObjectPos(objectid, ObjectPos[0], ObjectPos[1], ObjectPos[2]);

    CreateExplosion(ObjectPos[0], ObjectPos[1], ObjectPos[2], 10, 15.0)

    format(string, sizeof(string), "You are shooting at ObjectID: %i - X: %f - Y: %f - Z: %f", objectid, fX, fY, fZ);
    SendClientMessage(playerid, -1, string);

    DestroyDynamicObject( objectid );
    return true;
}
Updated Streamer by BigETI - Click Me!

EDIT

@BigETI: Thanks for the information, I've noticed that you've done it internally.
Reply
#4

No need for IsValidDynamicObject() inside OnShootDynamicObject() by the way.
Reply
#5

Perfect! Thanks you BigETI
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)