15.10.2017, 14:36
(
Последний раз редактировалось IlanZ; 16.10.2017 в 01:38.
)
PHP код:
#define DEAGLE_DAMAGE 60
#define COMBATSHOTGUN_DAMAGE 64
#define SHOTGUN_DAMAGE 52
#define MP5_DAMAGE 28
#define SNIPER_DAMAGE 45
#define RIFLE_DAMAGE 38
#define M4_DAMAGE 35
#define AK47_DAMAGE 30
#define MINIGUN_DAMAGE 500
new Float:VidaCarro[MAX_VEHICLES];
public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
{
if(hittype == BULLET_HIT_TYPE_VEHICLE)
{
GetVehicleHealth(vehicleid, VidaCarro[hitid]);
switch(weaponid)
{
case 24: VidaCarro[hitid] -= DEAGLE_DAMAGE);
case 25: VidaCarro[hitid] -= SHOTGUN_DAMAGE);
case 27: VidaCarro[hitid] -= COMBATSHOTGUN_DAMAGE);
case 29: VidaCarro[hitid] -= MP5_DAMAGE);
case 30: VidaCarro[hitid] -= AK47_DAMAGE);
case 31: VidaCarro[hitid] -= M4_DAMAGE);
case 33: VidaCarro[hitid] -= RIFLE_DAMAGE);
case 34: VidaCarro[hitid] -= SNIPER_DAMAGE);
case 38: VidaCarro[hitid] -= MINIGUN_DAMAGE);
}
SetVehicleHealth(vehicleid, VidaCarro[hitid]);
if(VidaCarro[hitid] < 250.0)
{
SetVehicleHealth(hitid, 0);
}
}
return 1;
}