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,
- 28.8,
- 80.0,
- 120.0,
- 141.6,
- 152.0,
- 62.4,
- 36.0,
- 26.4,
- 46.4,
- 46.4,
- 42.4,
- 240.0,
- 148.0,
- 173.6,
- 108.0, //Head
- 200.0,
- 62.5,
- 336.25,
- 144.0,
- 125.0,
- 187.5,
- 221.25,
- 237.5,
- 97.5,
- 180.0,
- 132.0,
- 72.5,
- 72.5,
- 66.25,
- 375.0,
- 231.25,
- 271.25
- };
- static const float gDamageTank[MAX_LIST] =
- {
- 22.7,
- 228.2,
- 44.3,
- 222.2,
- 30.9,
- 154.0,
- 201.9,
- 300.1,
- 339.4,
- 94.9,
- 31.8,
- 22.8,
- 59.6,
- 59.6,
- 49.9,
- 676.7,
- 323.7,
- 444.4,
- 22.7, //Head
- 228.2,
- 44.3,
- 222.2,
- 30.9,
- 154.0,
- 201.9,
- 300.1,
- 339.4,
- 94.9,
- 31.8,
- 22.8,
- 59.6,
- 59.6,
- 49.9,
- 676.7,
- 323.7,
- 444.4
- };
- static const float gDamageCharger[MAX_LIST] =
- {
- 13.9,
- 128.0,
- 37.0,
- 215.2,
- 23.6,
- 80.0,
- 120.0,
- 141.6,
- 152.0,
- 62.4,
- 23.9,
- 14.1,
- 46.4,
- 46.4,
- 42.4,
- 240.0,
- 148.0,
- 173.6,
- 108.0, //Head
- 200.0,
- 62.5,
- 336.25,
- 144.0,
- 125.0,
- 187.5,
- 221.25,
- 237.5,
- 97.5,
- 180.0,
- 132.0,
- 72.5,
- 72.5,
- 66.25,
- 375.0,
- 231.25,
- 271.25
- };
- 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") && StrEqual(classname, "weapon_chainsaw")) 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 - 19; 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 - 19; 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 - 19; 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