ItsMods

Full Version: Headshot plugin giving ammo or more points
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hello
can somebody make for me plugin when alive shot head shoot then get more points or ammo

sry for my bad english
Maybe someone come in handy Smile

C# Code:
Code:
using Addon;
using System;
using System.Collections.Generic;
namespace Headshot
{
    public class Headshot : CPlugin
    {
        public override int OnPlayerDamaged(ServerClient Attacker, ServerClient Victim, string Weapon, int Damage, string DamageMod, HitLocations HitLocation)
        {
            //if survival make headshot he get 50 ammo to primary weapon
            if (Attacker.Team == Teams.Allies && HitLocation == HitLocations.Head && Victim.Team == Teams.Axis && Damage >= Victim.Other.Health)
            {
                //Your code for getting points/ammo
                //Example:
                Attacker.Ammo.PrimaryAmmo += 50;
            }
            return Damage;
        }
    }
}