How to enable car getting damage without a driver?
#4

Quote:
Originally Posted by [NWA]Hannes
View Post
pawn Code:
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
    if(hittype == BULLET_HIT_TYPE_VEHICLE)
    {
        new Float:vHealth;
        GetVehicleHealth(hitid, vHealth);
        SetVehicleHealth(hitid, vHealth-50); //Each shot to the vehicle will deal 50 damage, you can change this yourself based on the weapon used etc.
    }
    return 1:
}
I've already done that, but more detailed with each weapon and separately for air vehicles, as weapons deal reduced damage on airplanes in comparison to other vehicles. But problem occurs with enabling RPG, HS Rocket, bombs and melee weapons, as explosion and fire don't deal damage to unoccupied vehicles, and melee is dealing different damage, depending on place where you hit it.

But thanks, anyway.


Quote:
Originally Posted by CodeStyle175
View Post
Maybe, it will get synced, when you put bot inside vehicle for 1 sec and remove it, i havent tried it, but maybe it works.
That came to my mind too, but I thought this would be easier, if it's possible of course. With bot should work, in theory, as NPC is still a "player" just not playable. Only not for second, bot should appear every time a player hits some vehicle. Maybe I will try that at the end, if that can work everything will be like if there is an actual someone in on driver seat. Wouldn't have to deal with bunch of codes for each weapon and vehicles, just to make sure there is enough NPCs for every car

Thanks, on advice if nothing more.
Reply


Messages In This Thread
How to enable car getting damage without a driver? - by Salvator - 01.03.2016, 19:50
Re: How to enable car getting damage without a driver? - by [NWA]Hannes - 01.03.2016, 20:02
Re: How to enable car getting damage without a driver? - by CodeStyle175 - 01.03.2016, 20:02
Re: How to enable car getting damage without a driver? - by Salvator - 01.03.2016, 21:55
Re: How to enable car getting damage without a driver? - by Chilli9434 - 01.03.2016, 21:57
Re: How to enable car getting damage without a driver? - by Salvator - 01.03.2016, 22:03

Forum Jump:


Users browsing this thread: 1 Guest(s)