Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma semicolon 1
- #pragma newdecls required
- #include <sdktools>
- #include <sdkhooks>
- #pragma tabsize 0
- #define MAX_LIST 36
- static const char gWeapons[MAX_LIST - 18][] =
- {
- "weapon_autoshotgun",
- "weapon_hunting_rifle",
- "weapon_pistol",
- "weapon_pistol_magnum",
- "weapon_pumpshotgun",
- "weapon_rifle",
- "weapon_rifle_ak47",
- "weapon_rifle_desert",
- "weapon_rifle_m60",
- "weapon_rifle_sg552",
- "weapon_shotgun_chrome",
- "weapon_shotgun_spas",
- "weapon_smg",
- "weapon_smg_mp5",
- "weapon_smg_silenced",
- "weapon_sniper_awp",
- "weapon_sniper_military",
- "weapon_sniper_scout"
- };
- static const float gDamageForEveryInfected[MAX_LIST] =
- {
- 21.6,
- 128.0,
- 40.0,
- 215.2,
- 75.2,
- 148.0,
- 173.6,
- 240.0,
- 26.4,
- 46.4,
- 42.4,
- 62.4,
- 46.4,
- 80.0,
- 120.0,
- 152.0,
- 28.8,
- 36.0,
- 108.0, //Head
- 200.0,
- 62.5,
- 336.25,
- 117.5,
- 231.25,
- 271.25,
- 375.0,
- 132.0,
- 72.5,
- 66.25,
- 97.5,
- 72.5,
- 125.0,
- 187.5,
- 237.5,
- 144.0,
- 180.0
- };
- static const float gDamageTank[MAX_LIST] =
- {
- 1.0,
- 60.8,
- 2.8,
- 37.7,
- 40.0,
- 98.4,
- 159.5,
- 291.0,
- 1.0,
- 4.4,
- 3.3,
- 23.4,
- 4.4,
- 48.0,
- 50.2,
- 106.4,
- 1.8,
- 1.8,
- 104.0,//Head
- 1920.0,
- 276.0,
- 3228.0,
- 1128.0,
- 2220.0,
- 2604.0,
- 3600.0,
- 107.0,
- 438.0,
- 324.0,
- 936.0,
- 438.0,
- 1200.0,
- 1800.0,
- 2280.0,
- 177.0,
- 178.0
- };
- static const float gDamageCharger[MAX_LIST] =
- {
- 216.0,
- 400.0,
- 125.0,
- 672.5,
- 235.0,
- 462.5,
- 542.5,
- 750.0,
- 264.0,
- 145.0,
- 132.5,
- 195.0,
- 145.0,
- 250.0,
- 375.0,
- 475.0,
- 288.0,
- 360.0,
- 27.8, // Head
- 256.0,
- 74.2,
- 430.4,
- 150.4,
- 296.0,
- 347.2,
- 480.0,
- 28.3,
- 92.8,
- 84.8,
- 124.8,
- 92.8,
- 160.0,
- 240.0,
- 304.0,
- 47.2,
- 47.8
- };
- public void OnClientPutInServer(int client)
- {
- SDKHook(client, SDKHook_TraceAttack, OnTakeDamage);
- }
- public Action OnTakeDamage(int victim, int &attacker, int &inflictor, float &damage, int &damagetype, int &ammotype, int hitbox, int hitgroup)
- {
- if (!(damagetype & DMG_BURN || damagetype & DMG_BLAST))
- {
- if (IsValidClient(attacker) && GetClientTeam(attacker) != 3)
- {
- if(IsValidClient(victim) && GetClientTeam(victim) != 2)
- {
- int iEnt = GetEntPropEnt(attacker, Prop_Send, "m_hUseEntity");
- if(IsValidEdict(iEnt) && iEnt > 0)
- {
- char sWeaponEx[32];
- GetEdictClassname(iEnt, sWeaponEx, sizeof(sWeaponEx));
- if (StrEqual(sWeaponEx, "prop_minigun") || StrEqual(sWeaponEx, "prop_minigun_l4d1"))
- {
- return Plugin_Continue;
- }
- }
- char classname[64];
- GetClientWeapon(attacker, classname, sizeof(classname));
- if(StrEqual(classname, "weapon_melee")) return Plugin_Continue;
- int vClass = GetEntProp(victim, Prop_Send, "m_zombieClass");
- switch(vClass)
- {
- case 1, 2, 3, 4, 5:
- {
- for(int i = 0; i < MAX_LIST; i++)
- {
- if(strcmp(classname, gWeapons[i]) == 0)
- {
- damage = gDamageForEveryInfected[i];
- if(hitgroup == 1)
- {
- damage = gDamageForEveryInfected[i + 18];
- }
- break;
- }
- }
- }
- case 6:
- {
- for(int i = 0; i < MAX_LIST; i++)
- {
- if(strcmp(classname, gWeapons[i]) == 0)
- {
- damage = gDamageCharger[i];
- if(hitgroup == 1)
- {
- damage = gDamageCharger[i + 18];
- }
- break;
- }
- }
- }
- case 8:
- {
- for(int i = 0; i < MAX_LIST; i++)
- {
- if(strcmp(classname, gWeapons[i]) == 0)
- {
- damage = gDamageTank[i];
- if(hitgroup == 1)
- {
- damage = gDamageTank[i + 18];
- }
- break;
- }
- }
- }
- }
- return Plugin_Changed;
- }
- }
- }
- return Plugin_Continue;
- }
- public bool IsValidClient(int client)
- {
- if (client <= 0)
- return false;
- if (client > MaxClients)
- return false;
- if (!IsClientInGame(client))
- return false;
- if (!IsPlayerAlive(client))
- return false;
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement