OnPlayerWeaponShot [PROBLEMS]
#1

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;
}
Reply
#2

BUMP
Reply
#3

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

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...
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)