Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <a_samp>
- #define MAX_HEALTH 100
- #define MAX_ARMOUR 100
- enum WeapInfo
- {
- Weapid,
- Damage,
- WeaponName[35],
- ArmourDamage
- }
- new Weapons[55][WeapInfo] = { // thanks to sa-mp wiki for these weapon ids
- {0,10,"Unarmed",10},
- {1,20,"Brass Knuckles",15},
- {2,35,"Golf Club",30},
- {3,35,"Nite Stick",35},
- {4,50,"Knife",45},
- {5,40,"Baseball Bat",35},
- {6,30,"Shovel",30},
- {7,30,"Pool Cue",30},
- {8,100,"Katana",90},
- {9,50,"Chainsaw",44},
- {10,5,"Purple Dildo",3},
- {11,5,"Small White Vibrator",3},
- {12,10,"Large White Vibrator",5},
- {13,5,"Silver Vibrator",3},
- {14,5,"Flowers",3},
- {15,25,"Cane",20},
- {16,100,"Grenade",90},
- {17,50,"Tear Gas",20},
- {18,50,"Molotov Coctail",20},
- {19,0,"Invalid Weapon",0},
- {20,0,"Invalid Weapon",0},
- {11,0,"Invalid Weapon",0},
- {22,40,"Colt 9mm",40},
- {23,40,"Silenced Colt 9mm",40},
- {24,45,"Desert Eagle",45},
- {25,50,"Shotgun",45},
- {26,50,"Sawn-off Shotgun",45},
- {27,60,"Combat Shotgun",50},
- {28,35,"Micro SMG",30},
- {29,35,"MP5K",35},
- {30,40,"AK-47",40},
- {31,40,"M4",40},
- {32,30,"Tec9",25},
- {33,100,"Country Rifle",90},
- {34,100,"Sniper Rifle",90},
- {35,100,"Rocket Launcher",90},
- {36,100,"HS Rocket Launcher",90},
- {37,30,"Flamethrower",20},
- {38,50,"Minigun",50},
- {39,100,"Satchel Charge",100}, //might not be synced
- {40,10,"Satchel Detonator",10}, //might not be synced
- {41,10,"Spraycan",10},
- {42,15,"Fire Extinguisher",15},
- {43,0,"Camera",0},
- {44,0,"Nightvision Goggles",0},
- {45,0,"Thermal Goggles",0},
- {46,100,"Thermal Goggles",100},
- {47,100,"Fake Pistol",100},
- {48,0,"Invalid Weapon",0},
- {49,50,"Vehicle",60},
- {50,200,"Heli-Blades",200},
- {51,100,"Explosion",100},
- {52,0,"Invalid Weapon",0},
- {53,20,"Drowned",25},
- {54,0,"Splat",0} // default damage on splat
- };
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Realistic Weapon Damage R2 ");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerTakeDamage(playerid, issuerid, Float: amount, weaponid)
- {
- if(issuerid != INVALID_PLAYER_ID)
- {
- new Float:Health,Float:Armour;
- GetPlayerHealth(playerid,Health);
- GetPlayerArmour(playerid,Armour);
- if(Health == 0)
- {
- SendDeathMessage(issuerid,playerid,weaponid);
- }
- else if(Armour > 0)
- {
- SetPlayerArmour(playerid,Armour+amount);
- GetPlayerArmour(playerid,Armour);
- SetPlayerArmour(playerid,Armour-Weapons[weaponid][ArmourDamage]);
- } else {
- SetPlayerHealth(playerid,Health+amount);
- GetPlayerHealth(playerid,Health);
- SetPlayerHealth(playerid,Health-Weapons[weaponid][Damage]);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement