SA-MP Forums Archive
OnPlayerWeaponShot [PROBLEMS] - 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 [PROBLEMS] (/showthread.php?tid=496237)



OnPlayerWeaponShot [PROBLEMS] - JaKe Elite - 21.02.2014

So i've notice this unique feature,
I've tried it over my JakAdmin, It works very well.
However, If the hittype isn't 0, and you shot a vehicle the explosion (i scripted) won't trigger.
However, The vehicle goes explode (i scripted it).

But when the hittype is 0, the explosion triggers.

Here is the code.

pawn Код:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(weaponid == 33)
    {
        if(shotGlobalEx[playerid] == 1)
        {
            if(hittype == BULLET_HIT_TYPE_NONE)
            {
                CreateExplosion(fX, fY, fZ, 7, 1.00);
            }
            else if(hittype == BULLET_HIT_TYPE_VEHICLE)
            {
                CreateExplosion(fX, fY, fZ+1.0, 7, 1.00);
                CreateExplosion(fX, fY, fZ+0.50, 7, 1.00);
                SetVehicleHealth(hitid, 27.0);
            }
        }
    }
    return 1;
}



Re: OnPlayerWeaponShot [PROBLEMS] - JaKe Elite - 21.02.2014

BUMP


Re: OnPlayerWeaponShot [PROBLEMS] - FilesMAker - 21.02.2014

Ok try to get the vehicule position don't use the returned float XYZ


Re: OnPlayerWeaponShot [PROBLEMS] - Threshold - 21.02.2014

After reading the first post, I still don't find it very clear what exactly you want this code to do. If they shoot nothing, you want to create an explosion, if you shoot a car, you want to create two explosions. So what's the problem exactly? 0_o

EDIT:
pawn Код:
if(hittype == BULLET_HIT_TYPE_NONE)
            {
                CreateExplosion(fX, fY, fZ, 7, 1.00);
            }
hittype == BULLET_HIT_TYPE_NONE
is the same as
hittype == 0

because BULLET_HIT_TYPE_NONE = 0...