Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <sourcemod>
- #include <sdktools>
- #include <sdkhooks>
- #pragma tabsize 0
- float EVERYONEAutoShot
- float EVERYONEHuntingRifle
- float EVERYONEPistol
- float EVERYONEMagnum
- float EVERYONEDesert
- float EVERYONEMilitary
- float EVERYONEScout
- float EVERYONEAwp
- float EVERYONESpas
- float EVERYONESmg
- float EVERYONESilenced
- float EVERYONESSG552
- float EVERYONESSG
- float EVERYONERifle
- float EVERYONEAk47
- float EVERYONEM60
- float EVERYONEPumpshotgun
- float EVERYONEChrome
- float HeadEveryOneAutoShot
- float HeadEveryOneHuntingRifle
- float HeadEveryOnePistol
- float HeadEveryOneMagnum
- float HeadEveryOneDesert
- float HeadEveryOneMilitary
- float HeadEveryOneScout
- float HeadEveryOneAwp
- float HeadEveryOneSpas
- float HeadEveryOneSmg
- float HeadEveryOneSilenced
- float HeadEveryOneSSG552
- float HeadEveryOneSSG
- float HeadEveryOneRifle
- float HeadEveryOneAk47
- float HeadEveryOneM60
- float HeadEveryOnePumpshotgun
- float HeadEveryOneChrome
- float TankAutoShot
- float TankHuntingRifle
- float TankPistol
- float TankMagnum
- float TankDesert
- float TankMilitary
- float TankScout
- float TankAwp
- float TankSpas
- float TankSmg
- float TankSilenced
- float TankSSG552
- float TankSSG
- float TankRifle
- float TankAk47
- float TankM60
- float TankPumpshotgun
- float TankChrome
- float HEADAutoShot
- float HEADHuntingRifle
- float HEADPistol
- float HEADMagnum
- float HEADDesert
- float HEADMilitary
- float HEADScout
- float HEADAwp
- float HEADSpas
- float HEADSmg
- float HEADSilenced
- float HEADSSG552
- float HEADSSG
- float HEADRifle
- float HEADAk47
- float HEADM60
- float HEADPumpshotgun
- float HEADChrome
- float HeadChargerAutoShot
- float HeadChargerHuntingRifle
- float HeadChargerPistol
- float HeadChargerMagnum
- float HeadChargerDesert
- float HeadChargerMilitary
- float HeadChargerScout
- float HeadChargerAwp
- float HeadChargerSpas
- float HeadChargerSmg
- float HeadChargerSilenced
- float HeadChargerSSG552
- float HeadChargerSSG
- float HeadChargerRifle
- float HeadChargerAk47
- float HeadChargerM60
- float HeadChargerPumpshotgun
- float HeadChargerChrome
- float ChargerAutoShot
- float ChargerHuntingRifle
- float ChargerPistol
- float ChargerMagnum
- float ChargerDesert
- float ChargerMilitary
- float ChargerScout
- float ChargerAwp
- float ChargerSpas
- float ChargerSmg
- float ChargerSilenced
- float ChargerSSG552
- float ChargerSSG
- float ChargerRifle
- float ChargerAk47
- float ChargerM60
- float ChargerPumpshotgun
- float ChargerChrome
- new bool:lateLoad;
- public APLRes:AskPluginLoad2(Handle:plugin, bool:late, String:error[], errMax)
- {
- lateLoad = late;
- return APLRes_Success;
- }
- public OnPluginStart()
- {
- if (lateLoad)
- {
- for (new client = 1; client <= MaxClients; client++)
- {
- if (IsClientInGame(client))
- {
- OnClientPutInServer(client);
- }
- }
- }
- }
- public OnClientPutInServer(client)
- {
- SDKHook(client, SDKHook_TraceAttack, OnTakeDamage);
- }
- public OnClientDisconnect(client)
- {
- SDKUnhook(client, SDKHook_TraceAttack, OnTakeDamage);
- }
- public Action:OnTakeDamage(victim, &attacker, &inflictor, &Float:damage, &damagetype, &ammotype, hitbox, 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) return Plugin_Continue;
- char sWeaponEx[32]
- GetEdictClassname(iEnt, sWeaponEx, sizeof(sWeaponEx));
- if (StrEqual(sWeaponEx, "prop_minigun") || StrEqual(sWeaponEx, "prop_minigun_l4d1")) return Plugin_Continue;
- decl String:classname[64];
- GetClientWeapon(attacker, classname, sizeof(classname));
- if(StrEqual(classname, "weapon_melee")) return Plugin_Continue;
- int vClass = GetEntProp(victim, Prop_Send, "m_zombieClass")
- if(vClass < 6)
- {
- if(StrEqual(classname, "weapon_autoshotgun"))
- {
- damage = EVERYONEAutoShot
- if(hitgroup == 1)
- {
- damage = HeadEveryOneAutoShot
- }
- }
- else if(StrEqual(classname, "weapon_hunting_rifle"))
- {
- damage = EVERYONEHuntingRifle
- if(hitgroup == 1)
- {
- damage = HeadEveryOneHuntingRifle
- }
- }
- else if(StrEqual(classname, "weapon_rifle"))
- {
- damage = EVERYONERifle
- if(hitgroup == 1)
- {
- damage = HeadEveryOneRifle
- }
- }
- else if(StrEqual(classname, "weapon_pistol"))
- {
- damage = EVERYONEPistol
- if(hitgroup == 1)
- {
- damage = HeadEveryOnePistol
- }
- }
- else if(StrEqual(classname, "weapon_pistol_magnum"))
- {
- damage = EVERYONEMagnum
- if(hitgroup == 1)
- {
- damage = HeadEveryOneMagnum
- }
- }
- else if(StrEqual(classname, "weapon_pumpshotgun"))
- {
- damage = EVERYONEPumpshotgun
- if(hitgroup == 1)
- {
- damage = HeadEveryOnePumpshotgun
- }
- }
- else if(StrEqual(classname, "weapon_rifle_ak47"))
- {
- damage = EVERYONEAk47
- if(hitgroup == 1)
- {
- damage = HeadEveryOneAk47
- }
- }
- else if(StrEqual(classname, "weapon_rifle_desert"))
- {
- damage = EVERYONEDesert
- if(hitgroup == 1)
- {
- damage = HeadEveryOneDesert
- }
- }
- else if(StrEqual(classname, "weapon_rifle_m60"))
- {
- damage = EVERYONEM60
- if(hitgroup == 1)
- {
- damage = HeadEveryOneM60
- }
- }
- else if(StrEqual(classname, "weapon_rifle_sg552"))
- {
- damage = EVERYONESSG552
- if(hitgroup == 1)
- {
- damage = HeadEveryOneSSG552
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_chrome"))
- {
- damage = EVERYONEChrome
- if(hitgroup == 1)
- {
- damage = HeadEveryOneChrome
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_spas"))
- {
- damage = EVERYONESpas
- if(hitgroup == 1)
- {
- damage = HeadEveryOneSpas
- }
- }
- else if(StrEqual(classname, "weapon_smg"))
- {
- damage = EVERYONESmg
- if(hitgroup == 1)
- {
- damage = HeadEveryOneSmg
- }
- }
- else if(StrEqual(classname, "weapon_smg_mp5"))
- {
- damage = EVERYONESSG
- if(hitgroup == 1)
- {
- damage = HeadEveryOneSSG
- }
- }
- else if(StrEqual(classname, "weapon_smg_silenced"))
- {
- damage = EVERYONESilenced
- if(hitgroup == 1)
- {
- damage = HeadEveryOneSilenced
- }
- }
- else if(StrEqual(classname, "weapon_sniper_awp"))
- {
- damage = EVERYONEAwp
- if(hitgroup == 1)
- {
- damage = HeadEveryOneAwp
- }
- }
- else if(StrEqual(classname, "weapon_sniper_scout"))
- {
- damage = EVERYONEScout
- if(hitgroup == 1)
- {
- damage = HeadEveryOneScout
- }
- }
- else if(StrEqual(classname, "weapon_sniper_military"))
- {
- damage = EVERYONEMilitary
- if(hitgroup == 1)
- {
- damage = HeadEveryOneMilitary
- }
- }
- return Plugin_Changed;
- }
- else if(vClass == 6)
- {
- if(StrEqual(classname, "weapon_autoshotgun"))
- {
- damage = ChargerAutoShot
- if(hitgroup == 1)
- {
- damage = HeadChargerAutoShot
- }
- }
- else if(StrEqual(classname, "weapon_hunting_rifle"))
- {
- damage = ChargerHuntingRifle
- if(hitgroup == 1)
- {
- damage = HeadChargerHuntingRifle
- }
- }
- else if(StrEqual(classname, "weapon_rifle"))
- {
- damage = ChargerRifle
- if(hitgroup == 1)
- {
- damage = HeadChargerRifle
- }
- }
- else if(StrEqual(classname, "weapon_pistol"))
- {
- damage = ChargerPistol
- if(hitgroup == 1)
- {
- damage = HeadChargerPistol
- }
- }
- else if(StrEqual(classname, "weapon_pistol_magnum"))
- {
- damage = ChargerMagnum
- if(hitgroup == 1)
- {
- damage = HeadChargerMagnum
- }
- }
- else if(StrEqual(classname, "weapon_pumpshotgun"))
- {
- damage = ChargerPumpshotgun
- if(hitgroup == 1)
- {
- damage = HeadChargerPumpshotgun
- }
- }
- else if(StrEqual(classname, "weapon_rifle_ak47"))
- {
- damage = ChargerAk47
- if(hitgroup == 1)
- {
- damage = HeadChargerAk47
- }
- }
- else if(StrEqual(classname, "weapon_rifle_desert"))
- {
- damage = ChargerDesert
- if(hitgroup == 1)
- {
- damage = HeadChargerDesert
- }
- }
- else if(StrEqual(classname, "weapon_rifle_m60"))
- {
- damage = ChargerM60
- if(hitgroup == 1)
- {
- damage = HeadChargerM60
- }
- }
- else if(StrEqual(classname, "weapon_rifle_sg552"))
- {
- damage = ChargerSSG552
- if(hitgroup == 1)
- {
- damage = HeadChargerSSG552
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_chrome"))
- {
- damage = ChargerChrome
- if(hitgroup == 1)
- {
- damage = HeadChargerChrome
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_spas"))
- {
- damage = ChargerSpas
- if(hitgroup == 1)
- {
- damage = HeadChargerSpas
- }
- }
- else if(StrEqual(classname, "weapon_smg"))
- {
- damage = ChargerSmg
- if(hitgroup == 1)
- {
- damage = HeadChargerSmg
- }
- }
- else if(StrEqual(classname, "weapon_smg_mp5"))
- {
- damage = ChargerSSG
- if(hitgroup == 1)
- {
- damage = HeadChargerSSG
- }
- }
- else if(StrEqual(classname, "weapon_smg_silenced"))
- {
- damage = ChargerSilenced
- if(hitgroup == 1)
- {
- damage = HeadChargerSilenced
- }
- }
- else if(StrEqual(classname, "weapon_sniper_awp"))
- {
- damage = ChargerAwp
- if(hitgroup == 1)
- {
- damage = HeadChargerAwp
- }
- }
- else if(StrEqual(classname, "weapon_sniper_scout"))
- {
- damage = ChargerScout
- if(hitgroup == 1)
- {
- damage = HeadChargerScout
- }
- }
- else if(StrEqual(classname, "weapon_sniper_military"))
- {
- damage = ChargerMilitary
- if(hitgroup == 1)
- {
- damage = HeadChargerMilitary
- }
- }
- return Plugin_Changed;
- }
- else if(vClass == 8)
- {
- if(StrEqual(classname, "weapon_autoshotgun"))
- {
- damage = TankAutoShot
- if(hitgroup == 1)
- {
- damage = HEADAutoShot
- }
- }
- else if(StrEqual(classname, "weapon_hunting_rifle"))
- {
- damage = TankHuntingRifle
- if(hitgroup == 1)
- {
- damage = HEADHuntingRifle
- }
- }
- else if(StrEqual(classname, "weapon_rifle"))
- {
- damage = TankRifle
- if(hitgroup == 1)
- {
- damage = HEADRifle
- }
- }
- else if(StrEqual(classname, "weapon_pistol"))
- {
- damage = TankPistol
- if(hitgroup == 1)
- {
- damage = HEADPistol
- }
- }
- else if(StrEqual(classname, "weapon_pistol_magnum"))
- {
- damage = TankMagnum
- if(hitgroup == 1)
- {
- damage = HEADMagnum
- }
- }
- else if(StrEqual(classname, "weapon_pumpshotgun"))
- {
- damage = TankPumpshotgun
- if(hitgroup == 1)
- {
- damage = HEADPumpshotgun
- }
- }
- else if(StrEqual(classname, "weapon_rifle_ak47"))
- {
- damage = TankAk47
- if(hitgroup == 1)
- {
- damage = HEADAk47
- }
- }
- else if(StrEqual(classname, "weapon_rifle_desert"))
- {
- damage = TankDesert
- if(hitgroup == 1)
- {
- damage = HEADDesert
- }
- }
- else if(StrEqual(classname, "weapon_rifle_m60"))
- {
- damage = TankM60
- if(hitgroup == 1)
- {
- damage = HEADM60
- }
- }
- else if(StrEqual(classname, "weapon_rifle_sg552"))
- {
- damage = TankSSG552
- if(hitgroup == 1)
- {
- damage = HEADSSG552
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_chrome"))
- {
- damage = TankChrome
- if(hitgroup == 1)
- {
- damage = HEADChrome
- }
- }
- else if(StrEqual(classname, "weapon_shotgun_spas"))
- {
- damage = TankSpas
- if(hitgroup == 1)
- {
- damage = HEADSpas
- }
- }
- else if(StrEqual(classname, "weapon_smg"))
- {
- damage = TankSmg
- if(hitgroup == 1)
- {
- damage = HEADSmg
- }
- }
- else if(StrEqual(classname, "weapon_smg_mp5"))
- {
- damage = TankSSG
- if(hitgroup == 1)
- {
- damage = HEADSSG
- }
- }
- else if(StrEqual(classname, "weapon_smg_silenced"))
- {
- damage = TankSilenced
- if(hitgroup == 1)
- {
- damage = HEADSilenced
- }
- }
- else if(StrEqual(classname, "weapon_sniper_awp"))
- {
- damage = TankAwp
- if(hitgroup == 1)
- {
- damage = HEADAwp
- }
- }
- else if(StrEqual(classname, "weapon_sniper_scout"))
- {
- damage = TankScout
- if(hitgroup == 1)
- {
- damage = HEADScout
- }
- }
- else if(StrEqual(classname, "weapon_sniper_military"))
- {
- damage = TankMilitary
- if(hitgroup == 1)
- {
- damage = HEADMilitary
- }
- }
- return Plugin_Changed;
- }
- }
- }
- }
- return Plugin_Continue;
- }
- public IsValidClient(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