Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Vehicle Damage System by nesguide2
- //------------------------------------------------------------------------------
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- new Float:VHP;
- if(hittype == 2)
- {
- GetVehicleHealth(hitid, VHP);
- if(!VehicleOccupied(hitid))
- {
- if(IsAirVehicle(hitid))
- {
- switch(weaponid)
- {
- case 22:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-8);
- }
- }
- case 23:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-13);
- }
- }
- case 24:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-46);
- }
- }
- case 25..26:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-15);
- }
- }
- case 27:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-19);
- }
- }
- case 28:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-6);
- }
- }
- case 29:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-8);
- }
- }
- case 30..31:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-10);
- }
- }
- case 32:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-6);
- }
- }
- case 33:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 34:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-41);
- }
- }
- case 38:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-46);
- }
- }
- }
- }
- else if(!IsAirVehicle(hitid))
- {
- switch(weaponid)
- {
- case 22:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 23:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-40);
- }
- }
- case 24:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-140);
- }
- }
- case 25..26:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-31);
- }
- }
- case 27:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-38);
- }
- }
- case 28:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-20);
- }
- }
- case 29:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 30..31:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-30);
- }
- }
- case 32:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-20);
- }
- }
- case 33:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-75);
- }
- }
- case 34:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-125);
- }
- }
- case 38:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-140);
- }
- }
- }
- }
- }
- else
- {
- if(IsAirVehicle(hitid))
- {
- switch(weaponid)
- {
- case 22:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-8);
- }
- }
- case 23:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-13);
- }
- }
- case 24:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-46);
- }
- }
- case 25..26:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-15);
- }
- }
- case 27:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-19);
- }
- }
- case 28:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-6);
- }
- }
- case 29:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-8);
- }
- }
- case 30..31:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-10);
- }
- }
- case 32:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-6);
- }
- }
- case 33:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 34:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-41);
- }
- }
- case 38:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-46);
- }
- }
- }
- }
- else if(!IsAirVehicle(hitid))
- {
- switch(weaponid)
- {
- case 22:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 23:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-40);
- }
- }
- case 24:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-140);
- }
- }
- case 25..26:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-31);
- }
- }
- case 27:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-38);
- }
- }
- case 28:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-20);
- }
- }
- case 29:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-25);
- }
- }
- case 30..31:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-30);
- }
- }
- case 32:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-20);
- }
- }
- case 33:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-75);
- }
- }
- case 34:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-125);
- }
- }
- case 38:
- {
- if(VHP > 250)
- {
- SetVehicleHealth(hitid, VHP-140);
- }
- }
- }
- }
- }
- }
- return 1;
- }
- stock IsAirVehicle(vehicleid)
- {
- switch(GetVehicleModel(vehicleid))
- {
- case 417,425,447,460,469,476,487,488,497,511,512,513,519,520,548,553,563,577,592,593: return 1;
- }
- return 0;
- }
- forward VehicleOccupied(vehicleid);
- public VehicleOccupied(vehicleid)
- {
- for(new i=0;i<MAX_PLAYERS;i++)
- {
- if(IsPlayerInVehicle(i,vehicleid)) return 1;
- }
- return 0;
- }
- //------------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement