SA-MP Forums Archive
OnPlayerWeaponShot object - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: OnPlayerWeaponShot object (/showthread.php?tid=624868)



OnPlayerWeaponShot object - Amads - 24.12.2016

So, I don't get why this doesn't work.
I create a dynamic object, and it is supposed to be destroyed when you shoot it, but I can shoot it how much I want and nothing happens.

PHP Code:
public OnPlayerWeaponShot(playeridweaponidhittypehitidFloat:fXFloat:fYFloat:fZ)
{
    if(
hittype == BULLET_HIT_TYPE_OBJECT)
    {
        for(new 
i50i++)
        {
            if(
hitid == objTest[i])
            {
                
DestroyDynamicObject(objTest[i]);
                
objTest[i] = -1;
                break;
            }
        }
    }
    return 
1;




Re: OnPlayerWeaponShot object - JaKe Elite - 24.12.2016

Use the callback OnPlayerShootDynamicObject

PHP Code:
public OnPlayerShootDynamicObject(playeridweaponidSTREAMER_TAG_OBJECT objectidFloat:xFloat:yFloat:z



Re: OnPlayerWeaponShot object - Amads - 24.12.2016

Quote:
Originally Posted by JaKe Elite
View Post
Use the callback OnPlayerShootDynamicObject

PHP Code:
public OnPlayerShootDynamicObject(playeridweaponidSTREAMER_TAG_OBJECT objectidFloat:xFloat:yFloat:z
Thanks!