Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define FILTERSCRIPT
- #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
- public OnFilterScriptInit()
- {
- printf("Unoccupied Vehicle Damage Loaded");
- return 1;
- }
- public OnFilterScriptExit()
- {
- printf("Unoccupied Vehicle Damage UnLoaded");
- return 1;
- }
- public OnPlayerWeaponShot(playerid, weaponid, hittype, hitid, Float:fX, Float:fY, Float:fZ)
- {
- if(hittype == 2)
- {
- if(!IsAnOccupiedVehicle(hitid))
- {
- new Float:hp;
- GetVehicleHealth(hitid, Float:hp);
- if(weaponid == 24)
- {
- SetVehicleHealth(hitid, hp-DEAGLE_DAMAGE);
- }
- if(weaponid == 25)
- {
- SetVehicleHealth(hitid, hp-SHOTGUN_DAMAGE);
- }
- if(weaponid == 27)
- {
- SetVehicleHealth(hitid, hp-COMBATSHOTGUN_DAMAGE);
- }
- if(weaponid == 29)
- {
- SetVehicleHealth(hitid, hp-MP5_DAMAGE);
- }
- if(weaponid == 30)
- {
- SetVehicleHealth(hitid, hp-AK47_DAMAGE);
- }
- if(weaponid == 31)
- {
- SetVehicleHealth(hitid, hp-M4_DAMAGE);
- }
- if(weaponid == 33)
- {
- SetVehicleHealth(hitid, hp-RIFLE_DAMAGE);
- }
- if(weaponid == 34)
- {
- SetVehicleHealth(hitid, hp-SNIPER_DAMAGE);
- }
- if(weaponid == 38)
- {
- SetVehicleHealth(hitid, hp-MINIGUN_DAMAGE);
- }
- }
- }
- return 1;
- }
- stock IsAnOccupiedVehicle(vehicleid)
- {
- for(new e = 0; e < MAX_PLAYERS; e++)
- {
- if(IsPlayerInAnyVehicle(e) && GetPlayerState(e) == PLAYER_STATE_DRIVER)
- {
- if(GetPlayerVehicleID(e) == vehicleid) return 0;
- else return 1;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment